728x90
반응형
단순 사칙연산 문제이다.
n, T = map(int, input().split())
li = list(map(int, input().split()))
for i in range(n):
if sum(li[:i+1]) > T:
print(i)
break
elif i == n-1:
print(n)
728x90
반응형
'Agorithm > 백준 알고리즘' 카테고리의 다른 글
백준 알고리즘 10395번 Automated Checking Machine(python) (0) | 2021.02.19 |
---|---|
백준 알고리즘 10406번 The fellowship of the ring(python) (0) | 2021.02.19 |
백준 알고리즘 10539번 수빈이와 수열(python) (0) | 2021.02.19 |
백준 알고리즘 10480번 Oddities(python) (0) | 2021.02.19 |
백준 알고리즘 10474번 분수좋아해?(python) (0) | 2021.02.19 |