#include <string>
#include <vector>
using namespace std;
vector<int> solution(vector<int> progresses, vector<int> speeds) {
vector<int> answer;
int idx = 0;
int days;
int max = 0;
int cnt = progresses.size();
for(int i=0; i<cnt; i++){
days = 0;
while(progresses[i]<100){
progresses[i] += speeds[i];
days++;
}
if( max < days){
answer.push_back(1);
max = days;
} else{
answer.back()++;
}
}
return answer;
}
'알고리즘' 카테고리의 다른 글
[C++/JAVA] 문자열 정리 (0) | 2021.12.20 |
---|---|
[프로그래머스] 여행경로 - 풀다가 GG치고 블로그 보고 풀이 (0) | 2021.09.28 |
[DFS] 백준 전투 - 1303, 백준 그림 - 1926 (SOS) (0) | 2021.08.12 |
[C++] 입출력 (cin vs getline) (0) | 2021.07.19 |
[그리디] 큰 수의 법칙 / [구현] 상하좌우 풀기 전 getline() (0) | 2021.07.14 |