[문제]
https://www.acmicpc.net/problem/13458
[코드]
#include <iostream>
#include <string>
using namespace std;
int p[1000001];
int main() {
//시험장 개수, 응시자 수, 총감독관이 감시할 수 있는 학생 수, 부감독관이 감시할 수 있는 학생 수
int n, b, c;
cin >> n;
for (int i = 0; i < n; i++)
cin >> p[i];
cin >> b >> c;
//최소 감독관 수
long long total = 0;
for (int i = 0; i < n; i++) {
int rest = p[i] - b;
total++;
if (rest <= 0) continue;
if (rest % c == 0)
total += rest / c;
else
total += rest / c + 1;
}
cout << total;
return 0;
}
'알고리즘 공부 및 문제 풀이 > 백준(BOJ)' 카테고리의 다른 글
[기출 중] 백준 1074 Z (0) | 2021.08.28 |
---|---|
[기출 중] 문자열 압축 (0) | 2021.08.26 |
[기출 하] 백준 1259 팰린드롬수 (0) | 2021.08.26 |
[기출 하] O, X 퀴즈 (0) | 2021.08.26 |
[기출 하] 깨알나라 신문 기사 (0) | 2021.08.26 |