-Code
n, s = map(int, input().split())
res = 0
for _ in range(n):
speed = int(input())
if res > s:
res -= 1
res += speed
print(res)
'Beakjoon&프로그래머스 > 파이썬' 카테고리의 다른 글
[백준/파이썬] 4459번 Always Follow the Rules in Zombieland (0) | 2023.10.19 |
---|---|
[백준/파이썬] 26509번 Triangle (0) | 2023.10.18 |
[백준/파이썬] 30156번 Malvika is peculiar about color of balloons (1) | 2023.10.16 |
[백준/파이썬] 23971번 ZOAC 4 (0) | 2023.10.15 |
[백준/파이썬] 30045번 ZOAC 6 (0) | 2023.10.14 |