250x250
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 |
Tags
- 원서읽기
- 백준
- PyQt
- swexpertacademy
- D4
- 원서
- BFS
- SQL
- 코테 대비
- readingbook
- STUDYENGLISH
- nightroutine
- 완전탐색
- 코딩테스트
- sw expert academy
- 직무면접
- 쉬운 알고리즘 문제
- 알고리즘 문제
- sw expert
- 코테
- 프로그래머스
- 원서읽자
- 알고리즘
- englishbook
- 삼성
- the midnight library
- 코테 준비
- MySQL
- dfs
- English
Archives
- Today
- Total
시나브로
[코딩테스트 연습 _ 스택/큐] 기능 개발 본문
728x90
#include <string>
#include <vector>
using namespace std;
vector<int> solution(vector<int> progresses, vector<int> speeds) {
vector<int> answer;
int list[110]={0};
for(int i=0;i<progresses.size();i++){
list[i]=100-progresses[i];
if(list[i]%speeds[i]!=0)
list[i]=list[i]/speeds[i]+1;
else
list[i]=list[i]/speeds[i];
}
for(int i=0;i<progresses.size();){
int count=1;
int box=list[i++];
while(box>=list[i]&&progresses.size()>i){
i++;
count++;
}
answer.push_back(count);
}
return answer;
}
https://programmers.co.kr/learn/courses/30/lessons/42586
프로그래머스
코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.
programmers.co.kr
728x90
'알고리즘 > 프로그래머스' 카테고리의 다른 글
[ 프로그래머스 ] 멀쩡한 사각형 (0) | 2020.04.04 |
---|---|
[ 프로그래머스 ] 124 나라의 숫자 (0) | 2020.04.04 |
[코딩테스트 연습 _ 스택/큐] 다리를 지나는 트럭 (0) | 2020.03.13 |
[코딩테스트 연습 _ 스택/큐] 탑 (0) | 2020.03.13 |
[SQL 최고점 Kit _ JOIN] 보호소에서 중성화한 동물 (0) | 2020.01.07 |