Try
[Programmers/C++] 기능개발 본문
출처
https://programmers.co.kr/learn/courses/30/lessons/42586
소스
#include <string>
#include <vector>#include <queue>#include <iostream>using namespace std;vector<int> solution(vector<int> pro, vector<int> spe){vector<int> answer;queue<int> q;for(int i = 0; i < pro.size(); i++){int date=0;while(pro[i] < 100){pro[i]+=spe[i];date++;}q.push(date);}while(!q.empty()){int fir=q.front();q.pop();int n = 0;int q_cnt=1;while(n<q.size()){int cnt=q.front();if(fir >= cnt){q.pop();q_cnt++;}elsebreak;}answer.push_back(q_cnt);}return answer;}
'Algorithm > Programmers' 카테고리의 다른 글
[Programmers/C++] 완주하지 못한 선수 (0) | 2018.11.18 |
---|---|
[Programmers/C++] 124 나라의 숫자 (0) | 2018.11.18 |
[Programmers/C++] 탑 (0) | 2018.11.15 |
[Programmers/C++] 소수의 합 (0) | 2018.11.15 |
[Programmers/C++] 카펫 (0) | 2018.11.12 |
Comments