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
- oracle
- 자바
- 문제해결
- binary search
- DP
- 건강
- 운동기록
- 시뮬레이션
- 알고리즘
- Java
- 코테
- 러닝일지
- dfs
- 문자열
- 이분탐색
- BOJ
- greedy
- SQL
- priorityqueue
- db
- COS PRO
- BFS
- MySQL
- 백준
- 프로그래머스
- 코딩테스트
- math
- 문제풀이
- SWEA
- 투포인터
Archives
- Today
- Total
슈콩
COS PRO 1급 JAVA 선풍기를 몇대 사야 하나요 본문


[소스 코드]
class Main {
public int solution(int k, int[] student) {
int answer = 0;
for(int i = 0; i < student.length; i++){
student[i] -= 4*k;
if(student[i] <= 0)
break;
answer += (student[i] + k - 1) / k;
}
return answer;
}
}