Submission #53327549
Source Code Expand
n, k = map(int, input().split())
a = list(map(int, input().split()))
ans = 0
now = 0
for i in range(n):
if now + a[i] > k:
now = a[i]
ans += 1
else:
now += a[i]
print(ans+1)
Submission Info
| Submission Time | |
|---|---|
| Task | B - AtCoder Amusement Park |
| User | noriaoki |
| Language | Python (PyPy 3.10-v7.3.12) |
| Score | 200 |
| Code Size | 215 Byte |
| Status | AC |
| Exec Time | 55 ms |
| Memory | 76700 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt |
| All | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00_sample_00.txt | AC | 54 ms | 76284 KiB |
| 00_sample_01.txt | AC | 55 ms | 76700 KiB |
| 00_sample_02.txt | AC | 55 ms | 76616 KiB |
| 01_random_03.txt | AC | 55 ms | 76564 KiB |
| 01_random_04.txt | AC | 55 ms | 76492 KiB |
| 01_random_05.txt | AC | 54 ms | 76336 KiB |
| 01_random_06.txt | AC | 54 ms | 76304 KiB |
| 01_random_07.txt | AC | 54 ms | 76244 KiB |
| 01_random_08.txt | AC | 54 ms | 76580 KiB |
| 01_random_09.txt | AC | 54 ms | 76304 KiB |
| 01_random_10.txt | AC | 55 ms | 76588 KiB |
| 01_random_11.txt | AC | 54 ms | 76448 KiB |
| 01_random_12.txt | AC | 54 ms | 76272 KiB |
| 01_random_13.txt | AC | 54 ms | 76444 KiB |
| 01_random_14.txt | AC | 54 ms | 76288 KiB |