Programming/Python & Data Structures
[Baekjoon/Python3] 10409번 서버
HooNeee
2020. 12. 6. 03:29
[Baekjoon/Python3] 10409번 서버
10409번: 서버
당신은 FCFS(First-Come, First-Served)의 규칙에 따라 요청된 일을 처리하는 서버를 담당하게 되었다. 매일, 당신은 일을 처리하기 위해 최대 T분 동안 서버에 시간을 할당할 수 있다. 당신은 오늘 주어
www.acmicpc.net
n, t = map(int, input().split())
nums = list(map(int, input().split()))
tot = 0
cnt = 0
for i in range(n):
if tot + nums[i] <= t:
tot += nums[i]
cnt += 1
else:
break
print(cnt)