| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 (추가 시간 없음) | 1024 MB | 44 | 23 | 20 | 54.054% |
You have a lot of exams today! And you have not yet prepared for any of them! At least you know from experience that if you study enough for an exam, you will for sure pass it quickly, well within the allotted time. Even better, you stared so long at the daunting course curricula that you now know exactly how much time you will need to study for each exam in order to pass it within the given time. If you do not study long enough, you will for sure fail it.
As it happens, your university has some weird bureaucratic rules that require you to attend all your exams. The horror! And leaving early is not allowed, unless you know for sure you passed it!
Given the full exam schedule of when each exam starts, how long each exam takes, how much time you need to study for each exam, and how quickly you can finish each exam you studied for, how many exams can you pass at most?
You may start studying at time 0ドル,ドル but can only study while not making an exam. The preparation for an exam does not have to be done in a contiguous block of time and may be interrupted.
The input consists of:
The exams are given in ascending order of start time, and do not overlap, i.e. \(e_i \leq s_{i+1}\) holds for \(1 \leq i < n\).
Output the maximum number of exams you can pass.
3 10 20 30 5 30 50 100 15 100 101 200 50
3
3 1000 1001 1002 1000 1003 1004 1005 500 1006 1007 1008 500
2
ICPC > Regionals > Europe > Northwestern European Regional Contest > Benelux Algorithm Programming Contest > BAPC 2023 E번