Problem:


Score : 200 points

Problem Statement

A ball will bounce along a number line, making N + 1 bounces. It will make the first bounce at coordinate D_1 = 0, and the i-th bounce (2 \leq i \leq N+1) at coordinate D_i = D_{i-1} + L_{i-1}.

How many times will the ball make a bounce where the coordinate is at most X?

Constraints

1 \leq N \leq 100

1 \leq L_i \leq 100

1 \leq X \leq 10000

All values in input are integers.

Input

Input is given from Standard Input in the following format:

N X
L_1 L_2 ... L_{N-1} L_N

Output

Print the number of times the ball will make a bounce where the coordinate is at most X.

Sample Input 1

3 6
3 4 5

Sample Output 1

2

The ball will make a bounce at the coordinates 0, 3, 7 and 12, among which two are less than or equal to 6.

Sample Input 2

4 9
3 3 3 3

Sample Output 2

4

The ball will make a bounce at the coordinates 0, 3, 6, 9 and 12, among which four are less than or equal to 9.



Sample input:
3 6
3 4 5


Sample output:
2

Submission status: Accepted

Solution code:
#!/usr/bin/python3
# -*- coding:utf-8 -*-

def main():
  n, x = map(int, input().strip().split())
  Ls   = list(map(int, input().strip().split()))
  d = 0
  count = 1
  for L in Ls:
    d += L
    if d <= x:
      count += 1
    else:
      break
  print(count)

if __name__=='__main__':
  main()

Submission status: Accepted

Solution code:
N, X = map(int, input().split())
L = list(map(int, input().split()))

cnt = 1
D = 0
for i in L:
    D += i
    if D > X:
        break
    else:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
from itertools import accumulate
n,x = map(int, input().split())
a = [0] + list(map(int, input().split()))
print(len([i for i in accumulate(a) if i < x+1]))

Submission status: Accepted

Solution code:
N,X = map(int,input().split())

L = [int(i) for i in input().split()]

D =[]
D.append(0)
x = 0

for i in range(N):
  x += L[i]
  D.append(x)
  
ans = 0

for i in range(N+1):
  
  if D[i] <= X:
    ans += 1

print(ans)

Submission status: Accepted

Solution code:
N, X = map(int, input().split())
Length = list(map(int, input().split()))

bounds = [0]
summ = 0

for i in range(N):
    summ += Length[i]
    bounds.append(summ)

ans = len([i for i in bounds if i <= X])
print(ans)

Submission status: Accepted

Solution code:
n, x = map(int, input().split())

L = list(map(int, input().split()))

A = [0]

for i in range(n):
    A.append(A[-1] + L[i])
t = 0
for i in A:
    if i <= x:
        t += 1
print(t)

Submission status: Accepted

Solution code:
n,x = map(int,(input().split()))
l = list(map(int,input().split()))
y = [0]
c = 0

for i in range(n):
    c += l[i]
    y.append(c)

print(len([j for j in y if j <= x]))

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, X = MAP()
L = LIST()

bound = 1
d = 0
for i in range(N):
	d = d + L[i]
	if d <= X:
		bound += 1
	else:
		break

print(bound)

Submission status: Accepted

Solution code:
from itertools import accumulate
n,x = map(int,input().split())
lst_l = [0] + list(map(int,input().split()))
lst_wa = list(accumulate(lst_l))
cnt = 0
for i in lst_wa:
    if i <= x:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
import itertools

N, X = list(map(int, input().split()))
B = list(map(int, input().split()))
Ba = list(itertools.accumulate(B))
cnt = 1
for i in Ba:
    if i <= X:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
import math
import string


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//math.factorial(n-r)*math.factorial(r)


n, x = map(int, input().split())
l = list(map(int, input().split()))
# print(l)
ll = [0]
sum = 0
for i in range(n):
    sum += l[i]
    ll.append(sum)
# print(ll)

cnt = 0
for i in range(n+1):
    if ll[i] <= x:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
n,x = map(int,input().split())
l = list(map(int, input().split()))

d = 0
ans = 1
for i in range(n):
    d = d + l[i]
    if d <= x :
         ans +=1
    else:
        break
print(ans)

Submission status: Accepted

Solution code:
N,X=map(int,input().split())
L=list(map(int,input().split()))
cumulative,count=0,1
for l in L:
    cumulative+=l
    if cumulative<=X:count+=1
print(count)

Submission status: Accepted

Solution code:
n,x=map(int,input().split())
l = list(map(int,input().split()))
point=0
bound = 1
for i in range(n):
    point += l[i]
    if point<= x:
        bound+=1
print(bound)

Submission status: Accepted

Solution code:
# 入力の高速化
import sys
input = sys.stdin.readline
N, X = map(int, input().split())
L = [int(x) for x in input().split()]

ans = 1
point = 0

for i in range(N) :
    point += L[i]
    if point <= X :
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
N, X = map(int, input().split())
L = list(map(int, input().split()))

# 累積和 cumulative sum
ans = 0
cumul = [0]
for i, l in enumerate(L):
  d = cumul[-1] + l
  if d > X:
    #print(i, d)
    ans = i + 1
    break
  cumul.append(d)
else:
  ans = N + 1

#print(cumul)
print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys


def solve(N: int, X: int, L: "List[int]"):
    d = 0
    for i, l in enumerate(L, 1):
        d += l      
        if d > X:
            print(i)
            return  
    else:
        print(i+1)
    return

# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    X = int(next(tokens))  # type: int
    L = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, X, L)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N,X=map(int,input().split())
L=list(map(int,input().split()))
cum,count=0,1
for l in L:
    cum+=l
    if cum<=X:count+=1
print(count)

Submission status: Accepted

Solution code:
N,X=map(int,input().split())
L=list(map(int,input().split()))
for i in range(N-1):L[i+1]+=L[i]
count=1
for i in range(N):
    if L[i]<=X:count+=1
print(count)

Submission status: Accepted

Solution code:
n,x=map(int,input().split())
l=list(map(int,input().split()))
ans=1
d=0
for i in range(n):
    d+=l[i]
    if d<=x:
        ans+=1
    else:
        break
print(ans)

Submission status: Accepted

Solution code:
n, x = map(int, input().split())
l = list(map(int, input().split()))

count = 0
d = [0]
for i in range(1, n+1):
    d.append(d[i - 1] + l[i - 1])

for i in range(len(d)):
    if d[i] <= x:
        count += 1

print(count)

Submission status: Accepted

Solution code:
x,y = map(int,input().split())

t = list(map(int,input().split()))

count = 0

memo = 0

for i in range(x+1):
    #print(i)
    if i == 0:
        count += 1
    else:
        memo += t[i-1]
        if memo <= y:
            count += 1
print(count)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n,x = map(int,input().split())
l = list(map(int,input().split()))
ans = 1
cum = 0
for i in range(n):
    if cum + l[i] <= x: 
        ans += 1
        cum += l[i]
    else : break
print(ans)

Submission status: Accepted

Solution code:
import sys
# input = sys.stdin.buffer.readline
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getlist():
    return list(map(int, input().split()))
import math
import heapq
import fractions
from collections import defaultdict, Counter, deque
MOD = 10**9 + 7
INF = 10**15

def getyaku(n):
    res = []
    for i in range(1, int(math.sqrt(n)) + 1):
        if n % i == 0:
            res.append(i)
            res.append(n // i)

    return(sorted(list(set(res))))

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

def main():
    n,m = getlist()
    nums = getlist()
    ans = 1
    tmp = 0
    for num in nums:
        tmp += num
        if tmp <= m:
            ans += 1
        else:
            print(ans)
            return
    print(ans)
    return

if __name__ == '__main__':
    main()

"""
9999
3

2916
"""

Submission status: Accepted

Solution code:
n, x, *a = map(int, open(0).read().split())
a = [0] + a
for i in range(n): a[i+1] += a[i]
ans = 0
for i in range(n+1): ans += (a[i]<=x)
print(ans)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
N, X = map(int, input().split())
a = list(map(int, input().split()))
cs = [0] * (N + 1)
for i in range(N): cs[i + 1] = cs[i] + a[i]
res = N + 1
for i in range(N + 1):
  if cs[i] > X:
    res = i
    break
print(res)

Submission status: Accepted

Solution code:
N,X=map(int,input().split())
L=list(map(int,input().split()))
tmp=0
ans=1
for i in range(N):
	tmp+=L[i]
	if tmp>X:
		print(ans)
		exit()
	else:
		ans+=1
print(ans)

Submission status: Accepted

Solution code:
N, X = map(int,input().split())
L = list(map(int,input().split()))
now = 0
ans = 1
for e in L:
    now += e
    if now <= X:
        ans += 1
    else:
        break
print(ans)

Submission status: Accepted

Solution code:
n, x = map(int, input().split())
l = list(map(int, input().split()))
ans = 0
t = 0
for i in range(n):
    if t <= x:
        ans += 1
    else:
        break
    t += l[i]
else:
    if t <= x:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
n,x=map(int,input().split())
a=list(map(int,input().split()))
cnt=1
now=0
if sum(a)<=x:
    print(n+1)
    exit()
for i in a:
    now+=i
    if now>x:
        print(cnt)
        exit()
    cnt+=1

Submission status: Accepted

Solution code:
N, X = map(int, input().split())
L_list = list(map(int, input().split()))
d_sum = 0
bounce_count = 0

for L in L_list:
    if d_sum+L>X:
        break
    d_sum = d_sum + L
    bounce_count = bounce_count + 1

print(bounce_count+1)

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))

n, x = na()
l = na()
d = 0
cnt = 1
for li in l:
    d += li
    if d <= x:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint
def ceil(a,b): return (a+b-1)//b
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    N,X=MI()
    L=LI()
    C=accumulate(L)
    ans = 1
    for c in C:
        if c <= X:
            ans += 1
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N,X = map(int,input().split())
L = list(map(int,input().split()))

D = 0
ans = 1
for i in L:
    D += i
    if D <= X:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
n,x=map(int,input().split())
l=list(map(int,input().split()))
cnt=1
D=0
for i in range(n):
    D+=l[i]
    if D<=x:
        cnt+=1
print(cnt)

Submission status: Accepted

Solution code:
N, X = map(int, input().split())
L = list(map(int, input().split()))
ans = 1
D = 0
for l in L:
    D += l
    if D <= X:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
N,X = map(int,input().split())
L = [int(i) for i in input().split()]

cnt = 1
D = 0
for l in L:
    D += l
    if D > X:
        print(cnt)
        exit()
    cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
import sys

def solve():
    input = sys.stdin.readline
    N, X = map(int, input().split())
    L = [int(l) for l in input().split()]
    count = 1
    now = 0
    for i, l in enumerate(L):
        now += l
        if now <= X: count += 1
    print(count)


    return 0

if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
n, x = map(int, input().split())
l = list(map(int, input().split()))

c = 1
h = 0
for i in l:
  h += i
  if h <= x:
    c +=1

print(c)

Submission status: Accepted

Solution code:
N,X = map(int,input().split())
L = list(map(int,input().split()))
cums = [0]
for a in L:
    cums.append(cums[-1] + a)
print(len([1 for c in cums if c <= X]))

Submission status: Accepted

Solution code:
def main():
    N, X = (int(i) for i in input().split())
    L = [int(i) for i in input().split()]
    from itertools import accumulate
    S = accumulate([0] + L)
    ans = 0
    for s in S:
        if s <= X:
            ans += 1

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
k, n = list(map(int, input().split(' ')))
l = list(map(int, input().split(' ')))
ct = 0
ans = 1
i = 0
while ct <= n and i < len(l):
  ct += l[i]
  ans += (ct <= n)
  i += 1
print(ans)

Submission status: Accepted

Solution code:
N, X = [int(s) for s in input().split(' ')]
Ls = [int(s) for s in input().split(' ')]
suma = [0]
for L in Ls:
    d = suma[-1] + L
    if d > X:
        break
    suma.append(d)
    
print(len(suma))

Submission status: Accepted

Solution code:
n, x = [int(i) for i in input().split()]
l = [0] + [int(i) for i in input().split()]
total = 0
cnt = 0
for i in l:
	total += i
	if total <= x:
		cnt += 1
	else:
		break
print(cnt)

Submission status: Accepted

Solution code:
n, x = map(int, input().split())
d = [0]
for l in map(int, input().split()):
    d.append(d[-1] + l)
print(sum(dx <= x for dx in d))

Submission status: Accepted

Solution code:
import os, sys, re, math

(N, X) = [int(n) for n in input().split()]
L = [int(n) for n in input().split()]

count = 1
D = 0
for l in L:
    D += l
    if D > X:
        break
    count += 1

print(count)

Submission status: Accepted

Solution code:
n,x=map(int,input().split())
l=list(map(int,input().split()))
s=0
count=1
for i in range(n):
    s+=l[i]
    if(s>x):
      break
    count+=1
    
print(count)

Submission status: Accepted

Solution code:
n, x = map(int, input().split())
l = list(map(int, input().split()))
tmp = 0
ans = 1
for i in range(n):
    tmp += l[i]
    if tmp > x:
        break
    ans += 1
    #print(ans, tmp)

print(ans)

Submission status: Accepted

Solution code:
N,X=map(int,input().split())
L=list(map(int,input().split()))
c=1
tmp=0
for i in range(N):
  tmp += L[i]
  if tmp <=X:
    c+=1

print(c)

Submission status: Accepted

Solution code:
N,X=map(int,input().split())
l=list(map(int,input().split()))
d=0
cnt=1
while True:
    
    d+=l[cnt-1]
    if d>X:
        print(cnt)
        break
    cnt+=1
    if cnt==N+1:
        print(N+1)
        break
else:
    
    print(cnt)

Submission status: Accepted

Solution code:
def main():
    N, X = (int(i) for i in input().split())
    L = [int(i) for i in input().split()]
    from itertools import accumulate
    S = accumulate([0] + L)
    print(len([e for e in S if e <= X]))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N,X=map(int,input().split())
L=list(map(int,input().split()))
total=0
count=1
for i in range(N):
    total+=L[i]
    if total<=X:
        count+=1
print(count)

Submission status: Accepted

Solution code:
N,X = map(int, input().split())
L = list(map(int, input().split()))

cnt=1
d=0
for i in range(N):
    if d+L[i]<=X:
        cnt+=1
        d=d+L[i]
    else:
        break
print(cnt)

Submission status: Accepted

Solution code:
import sys
read=sys.stdin.buffer.readline

N,X=map(int,read().split())
L=list(map(int,read().split()))

ans=1
res=0
for l in L:
    res+=l
    if res<=X:
        ans+=1
    else:
        break
print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# https://atcoder.jp/contests/abc130/tasks/abc130_b

n, x = [int(x) for x in input().split()]
li = [int(x) for x in input().split()]
li2 = [0] + [sum(li[:i + 1]) for i, n in enumerate(li)]
li2 = [n for n in li2 if n <= x]
print(len(li2))

Submission status: Accepted

Solution code:
n,x=map(int,input().split())
l=list(map(int,input().split()))
d=0
a=1
for i in range(n):
    d+=l[i]
    #print(d)
    if d<=x:
        a+=1
print(a)

Submission status: Accepted

Solution code:
N, X = map(int, input().split())
*L, = map(int, input().split())

v = 0
ans = 1

for i in L:
    v += i
    if v<=X:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
n,x,*l=map(int,open(0).read().split())
print(sum(x >= sum(l[:i+1])for i in range(n))+1)

Submission status: Accepted

Solution code:
import sys

n, b, *l = map(int, sys.stdin.read().split())

def main():
    d = 0
    for i in range(n):
        d += l[i]
        if d > b:
            return i + 1
    return n + 1

if __name__ == '__main__':
    ans = main()
    print(ans)

Submission status: Accepted

Solution code:
n,x=map(int,input().split())

l=list(map(int,input().split()))

ans=1

cursum=0

for i in range(n):
  cursum+=l[i]
  if cursum <= x:
    ans+=1
    
print(ans)

Submission status: Accepted

Solution code:
N, X = (int(nx) for nx in input().split())

count = 1
prev_d = 0
for ipt in input().split():
    curr_d = prev_d + int(ipt)
    if curr_d <= X:
        count += 1
        prev_d = curr_d
    else:
        break

print(count)

Submission status: Accepted

Solution code:
# #!/usr/bin/env python3
# # -*- coding: utf-8 -*-


def main():
    N, X = map(int, input().split())
    L = list(map(int, input().split()))
    count, D = 1, 0
    for l in L:
        D += l
        if D <= X:
            count += 1

    print(count)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n, x = map(int, input().split())
l = list(map(int, input().split()))

from itertools import accumulate
accum = list(accumulate(l))

ans = 1
for a in accum:
    if a <= x:
        ans += 1
    else:
        break
print(ans)

Submission status: Accepted

Solution code:
n,x=map(int,input().split())
#ls=[0]+[int(x) for i in input().split()]
ls=list(map(int,input().split()))

#d=[]
#d.append(0)
ans=0
d=0
for i in ls:
	d=d+i
	if d>x:
		break
	ans +=1
	
print(ans+1)

Submission status: Accepted

Solution code:
# Code for B - Bounding
# Use input() to fetch data from STDIN
[n, x] = [int(x) for x in input().split()]
l = [int(x) for x in input().split()]

count = 1
d = 0
for k in l:
    if d + k <= x:
        count += 1
        d += k
    else:
        break


print(count)

Submission status: Accepted

Solution code:
n, x = map(int, input().split())
L = list(map(int, input().split()))

d = 0
ans = 1
for i in range(n):
    if d + L[i] <= x:
        d += L[i]
        ans += 1
    else:
        break
        
print(ans)

Submission status: Accepted

Solution code:
n, x = map(int, input().split())
d = 0
b = 1
for l in map(int, input().split()):
  d += l
  if d <= x:
    b += 1
  else:
    break
print(b)

Submission status: Accepted

Solution code:
N, X = map(int, input().split())

L = list(map(int, input().split()))
sm = 0
ans = N + 1
for i in range(N):
    sm += L[i]
    if sm > X:
        ans = i + 1
        break

print(ans)

Submission status: Accepted

Solution code:
n, x = map(int, input().split())
l = [int(i) for i in input().split()]
d = 0
count = 1
for li in l:
    d += li
    if d <= x:
        count += 1
print(count)

Submission status: Accepted

Solution code:
n, x = map(int, input().split())
l = [int(i) for i in input().split()]
d = [0 for i in range(n + 1)]
count = 1
for i in range(1, n + 1):
    d[i] = d[i - 1] + l[i - 1]
    if d[i] <= x:
        count += 1
print(count)

Submission status: Accepted

Solution code:
n,x = map(int,input().split())
l = [int(i) for i in input().split()]
xg = [0]*(n+1)
for i in range(n):
    xg[i+1] = l[i] + xg[i]
count = 0
for i in xg:
    if i <= x:
        count += 1
print(count)

Submission status: Accepted

Solution code:
from itertools import accumulate
N, X = map(int, input().split())
L = list(map(int, input().split()))
acc = [0] + list(accumulate(L))

cnt = 0
for x in acc:
  if x <= X:
    cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
n,x=list(map(int,input().split()))
l=list(map(int,input().split()))
a=0
for i in range(n):
  a+=l[i]
#  print('i:',i,'a:',a)
  if a>x:break
if x<a:print(i+1)
else:print(i+2)

Submission status: Accepted

Solution code:
n,x=map(int,input().split())
l=list(map(int,input().split()))
cnt=1
d=0
for i in range(n):
    d+=l[i]
    if d<=x:
        cnt+=1
print(cnt)

Submission status: Accepted

Solution code:
n,x = map(int,input().split())
l = list(map(int,input().split()))
cur = ans = 0
for i in range(n):
    cur += l[i]
    if cur<=x:
        ans += 1
print(ans+1)

Submission status: Accepted

Solution code:
n, x = map(int, input().split())
l = list(map(int, input().split()))

cnt = 1
d = 0

for i in range(n):
    d += l[i]
    if(x >= d):
        cnt += 1
    else:
        break
            
print(cnt)

Submission status: Accepted

Solution code:
n,x = map(int,input().split())
l = list(map(int,input().split()))
count = 1
sum = 0
for i in range(n):
    sum += l[i]
    if sum  <= x:
        count += 1
print(count)

Submission status: Accepted

Solution code:
a = input().split()
N, X = [int(num) for num in a]
L = input().split()
L = [int(num) for num in L]
D = []
d = 0
for i in range(N):
  d += L[i]
  if d <= X:
    D.append(d)  
print(len(D)+1)

Submission status: Accepted

Solution code:
n,x = map(int,input().split())

l = list(map(int,input().split()))

count = 1
d = [0]*n
for i in range(n):
  d[i] = d[i-1] + l[i]
  if d[i] <= x:
    count +=1
print(count)

Submission status: Accepted

Solution code:
n,x = map(int,input().split())
l = list(map(int,input().split()))
ans = 0
i = 0

for _ in range(n):
    ans = ans + l[i]
    if ans <= x:
        i += 1
    
print(i+1)

Submission status: Accepted

Solution code:
N,X=map(int,input().split())
L=list(map(int,input().split()))

count=1
for i in range(N):
    if sum(L[:i+1])<=X:
        count+=1

print(count)

Submission status: Accepted

Solution code:
N, X = map(int, input().split())

L = list(map(int, input().split()))

ans = 1
sum_b = 0
for i in range(N):
    sum_b += L[i]
    if sum_b > X:
        print(ans)
        exit()
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
n,x=map(int,input().split())
*l,=map(int,input().split())
t=[0]
for i in range(n):
    d=l[i]+t[-1]
    t.append(d)
ans=[j for j in t if j <= x]
print(len(ans))

Submission status: Accepted

Solution code:
n, x = map(int, input().split())
l = list(map(int, input().split()))

ans = 1
d = 0
for i in l:
  d += i
  if d > x:
    break
  ans += 1
  
print(ans)

Submission status: Accepted

Solution code:
import itertools
N, X = map(int, input().split())
l = list(map(int, input().split()))
l.insert(0,0)
l_acc = list(itertools.accumulate(l))
answer = [x for x in l_acc if x<=X]
print(len(answer))

Submission status: Accepted

Solution code:
n, x = map(int, input().split())
l = list(map(int, input().split()))
d = 0
cnt = 1
for i in range(n):
    d += l[i]
    if d <= x:
        cnt += 1
    else:
        break
print(cnt)

Submission status: Accepted

Solution code:
N,X=map(int,input().split())
L=list(map(int,input().split()))
D=[]
D.append(0)
for i in range(1,N+1):
  D.append(D[i-1]+L[i-1])
s=0
for j in range(0,N+1):
  if D[j]<=X:
    s+=1
print(s)

Submission status: Accepted

Solution code:
n, x = list(map(int, input().split()))
l = list(map(int, input().split()))
c, p = 0, 0
while c < n:
    if p + l[c] <= x:
        p += l[c]
        c += 1
    else:
        break
print(c + 1)

Submission status: Accepted

Solution code:
n, x = map(int, input().split())
L = list(map(int, input().split()))
count = 0
sum = 0
for i in L:
    sum += i
    if sum <= x:
        count += 1
    else:
        continue
print(count+1)

Submission status: Accepted

Solution code:
N,X=map(int, input().split())
L=list(map(int, input().split()))
D=0
ans=1
for l in L:
    D=D+l
    if D<=X:
        ans+=1
    else:
        break
print(ans)

Submission status: Accepted

Solution code:
n,x=map(int,input().split())
L=list(map(int,input().split()))
ans=0
bns=0
for i in L:
    bns+=i
    if bns<=x:
        ans+=1
print(ans+1)

Submission status: Accepted

Solution code:
n,x=map(int,input().split())
l=[int(x) for x in input().split()]

ans=1
s=0

for ll in l:
    s+=ll
    if s <= x:
        ans+=1

print(ans)

Submission status: Accepted

Solution code:
N, X = map(int, input().split())
L = list(map(int, input().split()))
ans = 1
D = 0
for i in range(N):
  D = L[i] + D
  if D > X:
    break
  ans += 1
print(ans)

Submission status: Accepted

Solution code:
N, X = map(int, input().split())
nums = [int(i) for i in input().split()]


count = 0
for idx in range(N):
    count += nums[idx]

    if count > X:
        idx += 1
        break
else:
    idx += 2

print(idx)

Submission status: Accepted

Solution code:
N, X = map(int, input().split())
L = list(map(int, input().split()))
d = 0
count = 0
for i in range(N):
  d += L[i]
  if X < d:
    count = i + 1
    break
if count == 0:
  print(N + 1)
else:
  print(count)

Submission status: Accepted

Solution code:
n, x = map(int, input().split())
L = list(map(int, input().split()))

d, count = 0, 1
for i in range(n):
    d += L[i]
    if d <= x:
        count += 1

print(count)

Submission status: Accepted

Solution code:
n,k=map(int, input().split(' '))
a=list(map(int, input().split(' ')))
ans,s=0,0
for i in a:
  if s<=k: ans+=1
  else: break
  s+=i

if s<=k: ans+=1
print(ans)

Submission status: Accepted

Solution code:
n,x=(int(y) for y in input().split())
l=list(map(int,input().split()))
count=1
s=0
for i in range(len(l)):
  s+=l[i]
  if s<=x:
    count+=1
print(count)

Submission status: Accepted

Solution code:
n,x=map(int,input().split())
l=map(int,input().split())
cnt = 1
c=0

for li in l:
  c+=li
  if c <= x:
    cnt+=1
    
print(cnt)

Submission status: Accepted

Solution code:
n,x=map(int,input().split())
l=list(map(int,input().split()))
c=[0]
for p in range(n):
    c.append(c[p]+l[p])
r=0
for p in c:
    if p<=x:r+=1
print(r)

Submission status: Accepted

Solution code:
a,b = list(map(int,input().split()))
d = list(map(int,input().split()))
c = 0
count = 1
for i in range(a):
    c += d[i]
    if c <= b:
        count += 1
print(count)

Submission status: Accepted

Solution code:
n, x = [int(x) for x in input().split()]
l = [int(x) for x in input().split()]

cnt = 1
current = 0
for z in l:
    if current + z <= x:
        cnt += 1
        current += z
    else:
        break

print(cnt)

Submission status: Accepted

Solution code:
N, X = map(int, input().split())
*L, = map(int, input().split())
init = 0
ans = 1
for x in L:
    init = init + x
    if init <= X:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
n, x = map(int, input().split())
l = list(map(int, input().split()))

d = [0]*(n+1)
for i in range(n):
    d[i+1] = d[i] + l[i]
    
ans = 0
for j in range(n+1):
    if d[j] <= x:
        ans += 1
    else:
        break

print(ans)

Submission status: Accepted

Solution code:
n,x = map(int,input().split())
l=list(map(int,input().split()))

plot=0
cnt=1

for i in range(n):
    plot += l[i]
    if plot <= x:
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
#130
n,x = map(int, input().split())
l = list(map(int, input().split()))

res = 1
sm = 0
for i in range(0,n):
    if sm + l[i] <= x:
        res += 1
    sm += l[i]
print(res)

Submission status: Accepted

Solution code:
N,X = map(int,input().split())
L = list(map(int,input().split()))
Z = 0
cnt = 1
for i in range(N):
    Z += L[i]
    if Z <= X:
        cnt += 1
    else:
        break
print(cnt)

Submission status: Accepted

Solution code:
N, X = map(int, input().split())    
L = list(map(int, input().split()))
    
cnt = 1
    
a = 0

    
for i in range(len(L)):
    a += L[i]
    if a <= X:
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
N, X = map(int, input().split())
L = list(map(int, input().split()))
D = [0] * (N + 1)
ans = 1
for i in range(1, N + 1):
    D[i] = D[i - 1] + L[i - 1]
    if(D[i] <= X): ans += 1
print(ans)

Submission status: Accepted

Solution code:
n, x = map(int, input().split())
l = [int(i) for i in input().split()]

d = 0
c = 0

for i in l:
	d += i

	if d <= x:
		c += 1

print(c+1)

Submission status: Accepted

Solution code:
N, X = map(int, input().split())
Llist = list(map(int, input().split()))
now = 0
ans = 1
for i in range(N):
    now += Llist[i]
    if now <= X:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
N, X = map(int, input().split())
L = list(map(int, input().split()))
a = 1
total = 0
for i in range(N):
    total = total+L[i]
    if total <= X:
        a = a+1
print(a)

Submission status: Accepted

Solution code:
n,x = map(int, input().split())
l = list(map(int, input().split()))

d = 0
cnt = 1
for i in range(1,n+1):
    d += l[i-1]
    if d <= x: cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
import itertools
import bisect

N, X=map(int, input().split())
L=list(map(int, input().split()))
print(bisect.bisect_right(list(itertools.accumulate(L)), X)+1)

Submission status: Accepted

Solution code:
N,X=map(int,input().split())
L=list(map(int,input().split()))
D=0
cnt=1
for i in L:
    D +=  i
    if D<=X:cnt+=1
print(cnt)

Submission status: Accepted

Solution code:
N, X = map(int, input().split())
L = list(map(int, input().split()))
bound_count = 1
d = 0

for i in range(N):
	d += L[i]
	if X < d:
		break
	else:
		bound_count += 1

print(bound_count)

Submission status: Accepted

Solution code:
N,X = list(map(int,input().split()))
L_list = list(map(int,input().split()))

ans = 1
current = 0

for i in range(N):
  current += L_list[i]
  if current <= X:
    ans += 1
    
print(ans)

Submission status: Accepted

Solution code:
N, X = map(int, input().split())
L_i = list(map(int, input().split()))

Bounds = [0]

for i in range(N):
    Bounds.append(Bounds[i] + L_i[i])

count = 0

for i in Bounds:
    if i <= X:
        count += 1

print(count)