Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
Tags
- 두 동전
- 데이터전달
- Android
- broadcastreceiver
- Java
- 데이터
- 알고리즘
- 제어반전
- mysql
- IntelliJ
- Jenknis
- spring
- 백준
- ubuntu
- data
- git
- 큐빙
- 16197
- goland
- activity
- github
- 단축키
- insert
- vscode
- Algorithm
- intent
- service
- 안드로이드
- 프로그래머스
- 17837
Archives
- Today
- Total
해보자
프로그래머스_LV2_기능개발 본문
https://programmers.co.kr/learn/courses/30/lessons/42586
코딩테스트 연습 - 기능개발 | 프로그래머스
프로그래머스 팀에서는 기능 개선 작업을 수행 중입니다. 각 기능은 진도가 100%일 때 서비스에 반영할 수 있습니다. 또, 각 기능의 개발속도는 모두 다르기 때문에 뒤에 있는 기능이 앞에 있는 기능보다 먼저 개발될 수 있고, 이때 뒤에 있는 기능은 앞에 있는 기능이 배포될 때 함께 배포됩니다. 먼저 배포되어야 하는 순서대로 작업의 진도가 적힌 정수 배열 progresses와 각 작업의 개발 속도가 적힌 정수 배열 speeds가 주어질 때 각 배포마다 몇
programmers.co.kr
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | #include <algorithm> #include <string> #include <vector> #include <queue> using namespace std; vector<int> solution(vector<int> progresses, vector<int> speeds) { vector<int> answer; queue<double> q; for (int i = 0; i < progresses.size(); i++) q.push((100 - progresses[i]) / speeds[i]); while (!q.empty()) { int count = 1; double t = q.front(); q.pop(); while (!q.empty() && t >= q.front()) { count++; q.pop(); } answer.push_back(count); } return answer; } | cs |
'C++ > Solve & Think' 카테고리의 다른 글
백준 14503번 로봇 청소기 (0) | 2020.04.19 |
---|---|
프로그래머스_LV2_다리를 지나는 트럭 (0) | 2020.02.26 |
백준_7576번_토마토 (0) | 2020.02.20 |
프로그래머스_LV2_프린터 (0) | 2020.02.19 |
백준_10610번_30 (0) | 2020.02.12 |