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: Wrong Answer

Solution code:
N,X=map(int,input().split())
L=list(map(int,input().split()))
count=0
length=0
while length<=X:
	length=length+L[count]
	count=count+1
	if count==N:
		break
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(n):
    bound+=l[i]
    if bound>x:
        count=i+1
        break
        
print(count)

Submission status: Wrong Answer

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

#バウンド回数
cnt=0
#X以下の領域でボールが跳ねる回数
ans=1

for i in range(n):
  cnt += i
  if cnt <= x:
    ans += 1
  else:
    break
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python

def main():
    N, X = list(map(int, input().split()))
    L = list(map(int, input().split()))

    d = 0
    for i in range(N):
        d += L[i]
        if d > X:
            return i+1
            break
    return i+1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,x=list(map(int, list(input().split())))
Ls=list(map(int, list(input().split())))
t=0
for i in range(n):
    if sum(Ls[:i+1]) > x:
        t=i+1
        break
    else:
        t=n
if t != n:
    print(len(Ls[:t]))
else:
    print(len(Ls[:t])+1)

Submission status: Wrong Answer

Solution code:
n,x=list(map(int, list(input().split())))
Ls=list(map(int, list(input().split())))
t=0
for i in range(n):
    if sum(Ls[:i+1]) > x:
        t=i+1
        break
print(len(Ls[:t])) if t>0 else print(1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(bnd-1)

Submission status: Wrong Answer

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

print(bnd-1)

Submission status: Wrong Answer

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

print(bnd)

Submission status: Wrong Answer

Solution code:
#16 ABC130B
n,x=map(int,input().split())
l=list(map(int,input().split()))
a=[0]
for i in range(n):
    if a[-1]>x:
        del a[-1]
        break
    a.append(a[-1]+l[i])
print(len(a))

Submission status: Wrong Answer

Solution code:
#16 ABC130B
n,x=map(int,input().split())
l=list(map(int,input().split()))
a=[0]
for i in range(n):
    if a[-1]>x:
        break
    a.append(a[-1]+l[i])
print(len(a)-1)

Submission status: Wrong Answer

Solution code:
#16 ABC130B
n,x=map(int,input().split())
l=list(map(int,input().split()))
a=[l[0]]
for i in range(1,n):
    if a[-1]>x:
        break
    a.append(a[-1]+l[i])
print(len(a))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np

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

N=temp[0]
X=temp[1]

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

ind=1
while np.sum(L[:ind])<=X and ind<N:
  ind+=1
  
print(ind)

Submission status: Wrong Answer

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

bound = 0
before = 0
counter = 0

for i in range(N+1):
  if i > 0:
    bound = before -1 + ls[i-1]
    if bound <= X:
      counter +=1
    
  before = bound

print(counter)

Submission status: Wrong Answer

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

z = [0]
for i in range(1, n+1):
    z += [z[i-1] + ls[i-1]]

#print(z)

for i in range(len(z)):
    if z[i] > x:
        print(i)
        exit()

Submission status: Wrong Answer

Solution code:

n, x = map(int, input().split())
ls = list(map(int, input().split()))

z = [0]
for i in range(1, n+1):
    z += [z[i-1] + ls[i-1]]

#print(z)

for i in range(len(z)):
    if z[i] == x:
        print(i+1)
        exit()

    if z[i] >= x:
        print(i)
        exit()

Submission status: Wrong Answer

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

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

count = 0
sm = 0

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

print(count)

Submission status: Wrong Answer

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

z = [0]
for i in range(1, n+1):
    z += [z[i-1] + ls[i-1]]

#print(z)

count = 0
for i in z:
    if i > x:
        print(count)
        exit()
    if i == x:
        count += 1
        print(count)
        exit()

    count += 1

Submission status: Wrong Answer

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

z = [0]
for i in range(1, n+1):
    z += [z[i-1] + ls[i-1]]

#print(z)

count = 0
for i in z:
    if i > x:
        print(count)
        exit()
    count += 1

Submission status: Wrong Answer

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

dist = 0
ans = 0

for e in arr:
    if dist <= x:
        ans+=1
        dist += e

print(ans)

Submission status: Wrong Answer

Solution code:
#
import sys

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

d=0
b=0
for i in range(n):
    d=d+L[i]
    b+=1
    if d > x:
        print(b)
        sys.exit()    
    
print(b)

Submission status: Wrong Answer

Solution code:
#
import sys

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

d=0
b=0
for i in range(n):
    if d > x:
        print(b)
        sys.exit()
    d=d+L[i]
    b+=1

Submission status: Wrong Answer

Solution code:
#
import sys

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

d=0
b=0
for i in range(n):
    d=d+L[i]
    b+=1
    
    if d > x:
        print(b)
        sys.exit()

Submission status: Wrong Answer

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

for i in l:
    a+=1
    if su>x:
        
        break
    su+=i
   

print(a)

Submission status: Wrong Answer

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

for i in l:
    if su>x:
        
        break
    su+=i
    a+=1

print(a)

Submission status: Wrong Answer

Solution code:
n, x = [int(i) for i in input().split()]
l = [int(i) for i in input().split()]
count = 0
try:
    for i, c in enumerate(l):
        count += c
        if count>x:
            p = i+1
            break
    print(p)
except:
    print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

c = 0
d = 0

for i in range(n):
    if d <= x:
        d += l_list[i]
        c += 1
    else:
        break

print(c)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys 
N,X = map(int,input().split())
L = list(map(int,input().split()))
D = [0] + [[] for i in range(N-1)]
cnt = 1
for i in range(1,N):
  D[i] = D[i-1] + L[i-1]
  if D[i] <= X:
    cnt += 1
    continue
  else:
    print(cnt)
    sys.exit()
print(cnt)

Submission status: Wrong Answer

Solution code:
N, X =  [int(e) for e in input().split()]
lst = [int(e) for e in input().split()]
cnt = 0
for i in range(N):
  if i == 0:
    num = 0
  else:
    num = num + lst[i]
  if num <= X:
    cnt += 1
print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

s=0
count=1
for val in range(len(nums)):
    if s+nums[val] < x:
        s += nums[val]
        count += 1
    
print(count)

Submission status: Wrong Answer

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

s=0
count=1
for val in range(len(nums)):
    if s+nums[val] <= x:
        s += nums[val]
        count += 1
    
print(count)

Submission status: Wrong Answer

Solution code:
a,b = map(int, input().split())
Lists=list(map(int,input().split()))

count = 0
anser = 0

for List in Lists:
    if count <= b:
        anser = anser + 1
        count = count + List

if a == 0:
    print(1)  
else:
    print(anser)

Submission status: Wrong Answer

Solution code:
a,b = map(int, input().split())
Lists=list(map(int,input().split()))

count = 0
anser = 1
for List in Lists:
    if count <= b:
        anser = anser + 1
        count = count + List
if a == 0:
    print(1)  
else:
    print(anser)

Submission status: Wrong Answer

Solution code:
a,b = map(int, input().split())
Lists=list(map(int,input().split()))

count = 0
anser = 1
for List in Lists:
    if count <= b:
        anser = anser + 1
        count = count + List

print(anser)

Submission status: Wrong Answer

Solution code:
a,b = map(int, input().split())
Lists=list(map(int,input().split()))

count = 0
anser = 1
for List in Lists:
    if count <= b:
        anser = anser + 1
        count = count + List
        
print(anser)

Submission status: Wrong Answer

Solution code:
a,b = map(int, input().split())
Lists=list(map(int,input().split()))

count = 0
anser = 0
for List in Lists:
    if count <= b:
        anser = anser + 1
        count = count + List
        
if a == 0:
    print("1")
else:
    print(anser)

Submission status: Wrong Answer

Solution code:
a,b = map(int, input().split())
Lists=list(map(int,input().split()))

count = 0
anser = 0
for List in Lists:
    if count <= b:
        anser= anser + 1
        count = count + List

print(anser)

Submission status: Wrong Answer

Solution code:
a,b = map(int, input().split())
Lists=list(map(int,input().split()))

count = 0
anser = 0
for List in Lists:
    if count <= b:
        anser= anser + 1
        count = count + List
    else:
        break

print(anser)

Submission status: Wrong Answer

Solution code:
a,b = map(int, input().split())
Lists=list(map(int,input().split()))

count = 0
anser = 0
for List in Lists:
    if count <= b:
        anser= anser + 1
        count = count + List
    else:
        break

    print(anser+1)

Submission status: Wrong Answer

Solution code:
a,b = map(int, input().split())
Lists=list(map(int,input().split()))

count = 0
anser = 0
for List in Lists:
    if count <= b:
        anser= anser + 1
        count = count + List
    else:
        break

    print(anser)

Submission status: Wrong Answer

Solution code:
n,x=map(int,input().split());c=0
for i in input().split():
  x-=int(i);c+=1
  if x<=0:c+=(x==0);break
print(min(n+1,c))

Submission status: Wrong Answer

Solution code:
n,x=map(int,input().split());c=0
for i in input().split():
  x-=int(i);c+=1
  if x<0:break
print(min(n,c))

Submission status: Wrong Answer

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

position = 0

for i in range(N):
  position += bound_list[i]
  if position > X:
    print(i+1)
    break
  
  if i == N-1:
    print(i+1)

Submission status: Wrong Answer

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

position = 0

for i in range(N):
  position += bound_list[i]
  if position > X:
    print(i+1)
    break
  
  if i == N:
    print(i+1)

Submission status: Wrong Answer

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

for i in l:
    p += i
    if p <= x:
        bound += 1
    elif p == sum(l):        
        print(bound)
        break        
    else:
        print(bound)
        break

Submission status: Wrong Answer

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

for i in l:
    if p <= x:
        p += i
        bound += 1
    else:
        print(bound)
if p == sum(l):
    print(bound)

Submission status: Wrong Answer

Solution code:
n,x=map(int,input().split())
L=list(map(int,input().split()))
#print(L)
D=0
B=[0]
C=[]
for i in range(len(L)):
  D=D+L[i]
  B.append(D)
#print(B)
for i in range(len(L)):
  if B[i]<=x:
    C.append(i)
  else:
    pass
#print(C)
print(min(n+1,len(C)))

Submission status: Wrong Answer

Solution code:
n,x=map(int,input().split())
L=list(map(int,input().split()))
#print(L)
D=0
B=[0]
C=[]
for i in range(len(L)):
  D=D+L[i]
  B.append(D)
print(B)
for i in range(len(L)):
  if B[i]<=x:
    C.append(i)
  else:
    pass
print(C)
print(min(n+1,len(C)))

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
i = input().split(" ")
n = int(i[0])
x = int(i[1])
l = input().split(" ")
height = 0
count = n+1

for i in range(n):
    if (height + int(l[i]) <= x):
        height += int(l[i])
    else:
        count = i
        break

print(count+1)

Submission status: Wrong Answer

Solution code:
i = input().split(" ")
n = int(i[0])
x = int(i[1])
l = input().split(" ")
height = 0
count = 0

for i in range(n):
    if (height + int(l[i]) <= x):
        height += int(l[i])
    else:
        count = i
        break

print(count+1)

Submission status: Wrong Answer

Solution code:
#ABC 130, B - bounding
n, x = map(int, input().split(' '))

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

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

print(count)

Submission status: Wrong Answer

Solution code:
#ABC 130, B - bounding
n, x = map(int, input().split(' '))

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

D = []
for i in range(n):
    if i == 0:
        d = 0
    else:
        d = D[i-1] + L[i-1]
    if d <= x:
        D.append(d)
    else:
        break

print(len(D))

Submission status: Wrong Answer

Solution code:
#ABC 130, B - bounding
n, x = map(int, input().split(' '))

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

D = []
for i in range(n):
    if i == 0:
        d = 0
    else:
        d = D[i-1] + L[i-1]
    D.append(d)

E = [i for i in D if i <= x]
print(len(E))

Submission status: Wrong Answer

Solution code:
#ABC 130, B - bounding
n, x = map(int, input().split(' '))

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

D = []
for i in range(n):
    if i == 0:
        d = 0
    else:
        d = D[i-1] + L[i-1]
    D.append(d)
print(D)

E = [i for i in D if i <= x]
print(len(E))

Submission status: Wrong Answer

Solution code:
#ABC 130, B - bounding
n, x = map(int, input().split(' '))

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

D = []
D.append(0)

for i in range(1, n):
    d = D[i-1] + L[i-1]
    if d > x:
        break
    else:
        D.append(d)

print(len(D))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

def main():
	n, x = map(int, input().strip().split())
	L = list(map(int, input().strip().split()))
	i = 0
	c = 0
	for l in L:
		c += 1
		i += l
		if i > x:
			break
	print(c)

if __name__ == '__main__':
	main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for d in D:
    if d <= X:
        bounding += 1
        
print(bounding)

Submission status: Wrong Answer

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

for d in D:
    if d <= X:
        bounding += 1
        
print(bounding)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

d=[0]
for i in range(1,n+1):
    d.append(d[i-1]+l[i-1])
    if d[i]>x:
        print(i)
        break
    else:
        continue

Submission status: Wrong Answer

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

d=[0]
for i in range(1,n+1):
    d.append(d[i-1]+l[i-1])
    if d[i]>x:
        print(i)
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

height = 0
count = 1
for i in range(0, N-1):
    height += L[i]
    if height <= D:
        count += 1

print(count)

Submission status: Wrong Answer

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

pf = [arr[0] for i in range(n)]

for i in range(1, n):
    pf[i] = pf[i-1] + arr[i]

c = 0
for i in pf:
    c += (i <= x)

print(c)

Submission status: Wrong Answer

Solution code:
n, x = map(int, input().split())
L = [int(i) for i in input().rstrip().split()]
jmp = 0
cnt = 0

for j in range(0, n):
    if jmp <= x:
        cnt += 1
    jmp = jmp + L[j]
    
print(cnt)

Submission status: Wrong Answer

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

count = 1
p = 0
for l in L:
    if p <= x:
        p += l
        count += 1
print(count)

Submission status: Wrong Answer

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

count = 0
p = 0
for l in L:
    if p <= x:
        p += l
        count += 1
print(count)

Submission status: Wrong Answer

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

count = 0
p = 0
for l in L:
    if count <= x:
        p += l
        count += 1
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

s = 0
for i, l in enumerate(L):
    s += l

    if s > x:
        break

print(i + 1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, X = map(int,input().split())
L = list(map(int,input().split()))
i = 1
D = [0]
while i < N and D[i-1] <= X:
  D += [D[i-1] + L[i-1]]
  i += 1
if D[i-1] > X:
  i -= 1
print(i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

d = 0
for i in range(len(l)):
  d += l[i]
  if d > x:
    print(i)
    break
else:
  print(len(l))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,x = map(int,input().split())
lis = list(map(int,input().split()))
d = 0
c = 0
for i in lis:
    d = d + i
    c += 1
    if d > x:
        print(c)
        break
    if c == n:
        print(c)

Submission status: Wrong Answer

Solution code:
#coding:utf-8
n, x = map(int, input().split())
l = list(map(int, input().split()))

d = [0]

#跳ねる座標を計算
for i in range(1, n):
    tmp = d[i-1] + l[i-1]
    d.append(tmp)

#print(d)

#判定
counter = 0

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

print(counter)

Submission status: Wrong Answer

Solution code:
#coding:utf-8
n, x = map(int, input().split())
l = list(map(int, input().split()))

d = [0]

#跳ねる座標を計算
for i in range(1, n):
    tmp = d[i-1] + l[i-1]
    d.append(tmp)

print(d)

#判定
counter = 0

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

print(counter)

Submission status: Wrong Answer

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

while inX:
    if ans > x:
        inX = False
        cnt -= 1
    elif cnt == n:
        break
    ans += l[cnt]
    cnt += 1
print(cnt)

Submission status: Wrong Answer

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

while inX:
    if ans > x:
        inX = False
        cnt -= 1
    elif cnt >= n:
        break
    ans += l[cnt]
    cnt += 1
print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

print(count)

Submission status: Wrong Answer

Solution code:
_, X = map(int, input().split())
L = [int(i) for i in input().split()]
d = 0
for i, l in enumerate(L):
    d += l
    if d > X:
        break
print(i+1)

Submission status: Wrong Answer

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

count=0
d=0
i=0
while d<=x:
  ++count
  d=d+l[i]
  ++i
print(count-1)

Submission status: Wrong Answer

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

count=0
d=0
i=0
while d<=x:
  ++count
  d=d+l[i]
  ++i
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

count= 1
l = list(map(int, input().split()))
d = 0
for i in l:
    d = d + i
    if x > d:
        count+=1 
    else:
        break
print(count)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
limit_num, limit_cor = tuple(int(i) for i in input().split(" "))
l_list = tuple(int(i) for i in input().split(" "))
dp = [0]


def jump_cor(n):
    if len(dp) < n + 1:
        dp.append(dp[n - 1] + l_list[n - 1])
    return dp[n]


for i in range(limit_num + 1):
    if jump_cor(i) > limit_cor:
        break
print(i)

Submission status: Wrong Answer

Solution code:
n, x = list(map(int, input().split()))
L = list(map(int, input().split()))
# S = [list(map(int, input().split())) for i in range(n)]

Di = 0
ans = list()
for l in L:
    Di += l
    ans.append(Di)

for i, a in enumerate(ans):
    if a > x:
        print(i+1)
        break
else:
    print(i+1)

Submission status: Wrong Answer

Solution code:
n, x = list(map(int, input().split()))
L = list(map(int, input().split()))
# S = [list(map(int, input().split())) for i in range(n)]

Di = 0
ans = list()
for l in L:
    Di += l
    ans.append(Di)

for i, a in enumerate(ans):
    if a > x:
        print(i+1)
        break