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,m = [int(i) for i in input().split()]
l = [int(i) for i in input().split()]

num = 0
ct = 0
while num <= m and ct < len(l):
    ct +=1
    num += l[ct-1]
    
print(ct)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

D = 0
count = 0
for i in range(N):
    if D > X:
        break 
    else:
        D += L[i]
        count += 1
print(count)

Submission status: Wrong Answer

Solution code:
while True:
    try:
        N, X = map(int, input().split())
        L = list(map(int, input().split()))
        D = [0]
        for i in range(1, N+1):
            tmp = D[i-1] + L[i-1]
            D.append(tmp)
            if tmp > X:
                break
        print(i)
    except:
        break

Submission status: Wrong Answer

Solution code:
while True:
    try:
        N, X = map(int, input().split())
        L = list(map(int, input().split()))
        D = 0
        i = 0
        while (D <= X):
            D += L[i]
            i += 1
        print(i)
    except:
        break

Submission status: Wrong Answer

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

ans=0
jump=0
for l in L:
  if jump<=x:
    ans+=1
  jump=jump+l
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# B - Bounding
N, X = map(int,input().split())
L = list(map(int, input().split()))
D = 0
count = 0

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

Submission status: Wrong Answer

Solution code:
# B - Bounding
N, X = map(int,input().split())
L = list(map(int, input().split()))
D = 0
count = 0

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-


from sys import stdin
import itertools


############################################

# read data for n sequences.
temp = stdin.readline().split()
N = int(temp[0])
X = int(temp[1])

data = []
write = stdin.readline().split()
for i in range(N):
    data.append(int(write[i]))
    
count = 0
dis = 0

for d in data:
    if dis <= X:
        count += 1
        dis += d
    else:
        break

print(count)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-


from sys import stdin

############################################

# read data for n sequences.
temp = stdin.readline().split()
N = int(temp[0])
X = int(temp[1])

data = []
write = stdin.readline().split()
for i in range(N):
    data.append(int(write[i]))
    
count = 0
dis = 0

for d in data:
    if dis <= X:
        count += 1
        dis += d
    else:
        break

print(count)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-


from sys import stdin

############################################

# read data for n sequences.
temp = stdin.readline().split()
N = int(temp[0])
X = int(temp[1])

data = []
write = stdin.readline().split()
for i in range(N):
    data.append(int(write[i]))
    
count = 0
dis = 0

for d in data:
    if dis <= X:
        count += 1
        dis += 0
    else:
        break

print(count)

Submission status: Wrong Answer

Solution code:
n,disup=map(int,input().split())
A=list(map(int,input().split()))
dis=0
ans=0
for i in A:
  dis+=i
  if dis>disup:
    print(ans)
    exit()
  if dis==disup:
    print(ans+1)
    exit()
  ans+=1

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):
    if D <= X:
        ans += 1
    D = D + L[i]

print(ans)

Submission status: Wrong Answer

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

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

print(len(l))

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):
  D+=L[i]
  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()))
D = 0
ans = 1
for l in L:
  D += l
  if D <= X:
    ans += 1
  else:
    print(ans)
    break

Submission status: Wrong Answer

Solution code:
N, X = map(int, input().split())
L=list(map(int,input().split()))
d = L[0]
i = 1
c=1
while(d<=X):
  c += 1
  d = d + L[i]
print(c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, X = map(int,input().split())
L = list(map(int,input().split()))
ans = 1
D = L[0]
while D<=X and ans<N+1:
    ans+=1
    if ans < N+1: #N+1回以降はねない
        D+=L[ans-1]
    print("座標 {}".format(D))
print(ans)

Submission status: Wrong Answer

Solution code:
n,x = map(int,input().split())
ls = [int(i) for i in input().split()]
count = 0
flag = 0 
for i in range(n):
    if flag > x:
        break
    else:
        count = count + 1
        flag = flag + ls[i]

print(count)

Submission status: Wrong Answer

Solution code:
N, X = map(int, input().split())
L = [int(l) for l in input().split()]
ans = 1
place = 0
for l in L:
    place += l
    if place > X:
        print(ans)
        exit()
    ans += 1

Submission status: Wrong Answer

Solution code:
N, X = map(int, input().split())
L = [int(l) for l in input().split()]
ans = 0
place = 0
for l in L:
    ans += 1
    place += l
    if place > X:
        print(ans)
        exit()

Submission status: Wrong Answer

Solution code:
n,x=input().split()
L = list(input().split())
d = 0
i = 0
while d <= int(x) and i<int(n):
    d+=int(L[i])
    i+=1
print(i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n, x = map(int, input().split())
l = [int(i) for i in input().split()]
d = [0]
cnt = 1
while cnt != n + 1 and d[-1] <= x:
	d.append(d[-1] + l[cnt - 1])
	cnt += 1
print(len(d) - 1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

location = 0
for bounce in range(N):
    location += L[bounce]
    if location > X:
        break
print(bounce+1)

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

Solution code:
N,X=map(int, input().split())
L=list(map(int, input().split()))
s=[x for x in range(N) if sum(L[:x])<=X]
if N>=len(s):
  print(len(s))
else:
  print(N+1)

Submission status: Wrong Answer

Solution code:
N,X=map(int, input().split())
L=list(map(int, input().split()))
s=[x for x in range(N) if sum(L[:x])<=X]
print(len(s))

Submission status: Wrong Answer

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

s = 0
cnt = 0
for n in range(N):
    s += L[n]
    cnt += 1
    if s > X:
        break

print (cnt)

Submission status: Wrong Answer

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

s = 0
for n in range(N):
    s += L[n]
    if s > X:
        break

print (n + 1)

Submission status: Wrong Answer

Solution code:
from itertools import accumulate


def solve(string):
    n, x, *l = map(int, string.split())
    return str(len(list(filter(lambda a: a <= x, list(accumulate(l))))) + 1)


if __name__ == '__main__':
    print(solve(input()))

Submission status: Wrong Answer

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

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

count=1

kazu=0

for i in hr :
    
    kazu += i 
    
    if i <= X:
        count +=1

print(count)

Submission status: Wrong Answer

Solution code:
n,x = map(int,input().split())
l = [int(i) for i in input().split()]
for i in range(n-1):
    l[i+1] += l[i] 
    if l[i+1] > x:
        print(i+2)
        quit()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,x =map(int,input().split())
l1=list(map(int,input().split()))
l2=[0]
for i in range(len(l1)):
  l2.append(sum(l2)+l1[i])
ans=0
i=0
while i<len(l2):
  if l2[i]<x:
    ans+=1
  i+=1
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(N):
    D.append(D[i]+L[i])
    if D[i+1]>X:
        break
print(len(D)-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

count=0
for i,j in enumerate(itertools.accumulate(L)):
    if X<j:
        count=i+1
        break

print(count)

Submission status: Wrong Answer

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

count=0
for i,j in enumerate(itertools.accumulate(L)):
    if j>X:
        count=i+1
        break

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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(len(d)-1)
        exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,x=map(int,input().split())
l=list(map(int,input().split()))
dist=0
ans=1
for i in range(2,n+1): 
    distn=dist+l[i-1]
    if x<distn:
        break
    dist=distn
    ans+=1
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 += L[i - 1]
    if d > X:
        print(i)
        exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

i = 0
D = 0
while D <= X and i <= N:
    D += L[i-1]
    i += 1
print(i)

Submission status: Wrong Answer

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

D = 0
i = 0
while(1):
  if i >= N or D > X:
    break
  D += L[i]
  i += 1
print(i)

Submission status: Wrong Answer

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

D = 0
i = 0
while D<=X and i<N:
  D += L[i]
  i += 1
print(i)

Submission status: Wrong Answer

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

D = 0
i = 1
while D<=X:
  if X<D or N<=i:
    break
  D += L[i-1]
  i += 1
print(i)

Submission status: Wrong Answer

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

D = 0
i = 0
while D<=X:
  if X<D or N<=i:
    break
  D += L[i-1]
  i += 1
print(i)

Submission status: Wrong Answer

Solution code:
N,X = map(int,input().split())
L = list(map(int,input().split()))
D = [0]
count = 0

for i in range(1,N):
  D.append(D[i-1]+L[i-1])
  
for j in range(len(D)):
  if D[j] <= X:
    count += 1
  else:
    break
print(count)

Submission status: Wrong Answer

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

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

a = 0
cnt = 0
for n in range(N):
    if a <= X:
       cnt = cnt + 1 

    a = a + L[n]

print(cnt)

Submission status: Wrong Answer

Solution code:
n,x=map(int,input().split())
L=[int(i)for i in input().split()]
a=0
c=0
for i in L:
    a+=i
    if a<=x:
        c+=1
    else:
        print(c+1)
        break

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):
  d = d + l[i]
  if d >= 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
for i in range(n):
  d = d + l[i]
  if d > 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]+L
 
l=int(0)
counter=int(0)
while l+L[counter]<=X and counter<N:
  l+=L[counter]
  counter+=int(1)
  if counter==N+1:
    break
  
print(counter)

Submission status: Wrong Answer

Solution code:
N, X=map(int, input().split())
L=list(map(int, input().split()))
L=[0]+L
 
l=int(0)
counter=int(0)
while l+L[counter]<=X and counter<N:
  l+=L[counter]
  counter+=int(1)
  
print(counter)

Submission status: Wrong Answer

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

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):
	if i == 0:
		d = 0
	else:
		print(i, d)
		d += L[i-1]
	if d > x:
		i -= 2
print(i+1)

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):
	if i == 0:
		continue
	else:
		d += L[i-1]
	if d > x:
		break
print(i)

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):
	if i == 0:
		continue
	else:
		d += L[i-1]
	print(d)
	if d > x:
		break
print(i)

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):
	if i == 0:
		continue
	else:
		d += L[i-1]
	if d > x:
		i -= 1
		break
print(i)

Submission status: Wrong Answer

Solution code:
import sys
n, x = map(int, sys.stdin.readline().split())
llist =list(map(int, sys.stdin.readline().split()))

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

Submission status: Wrong Answer

Solution code:
import sys
n, x = map(int, sys.stdin.readline().split())
llist = list(map(int, sys.stdin.readline().split()))

d = 0
ans = 0
while d <= x:
  ans += 1
  d += llist[ans-1]
  if ans >= n:
    print(n+1)
    exit()
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(n):
    d += l[i]
    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()))
d = 0

for i in range(n):
    d = d + l[i]
    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()))
ans,d=0,0

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

Submission status: Wrong Answer

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

for i in l:
  if d<=x:
    ans+=1
    d+=i
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
 
stdin = sys.stdin
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

n,x=na()
l=na()

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

Submission status: Wrong Answer

Solution code:
#B - Bounding(ABC130)
A=list(map(int, input().split()))
L=list(map(int, input().split()))
D=0
C=1
for i in L:
    D+=i
    if D<=A[1]:
        C+=1
    else:
        print(C)
        break
else:
    print(A[0])

Submission status: Wrong Answer

Solution code:
from sys import stdin
n, x = map(int, input().split())
l = [int(x) for x in stdin.readline().rstrip().split()]
cnt =[]

cnt.append(0)
for i in range(n):
	cnt.append(cnt[i]+l[i])


for i in range(n+1):
	if cnt[i] > x:
		print(i)
		exit()
print(i)

Submission status: Wrong Answer

Solution code:
from sys import stdin
n, x = map(int, input().split())
l = [int(x) for x in stdin.readline().rstrip().split()]
cnt =[]
c = 0
cnt.append(0)
for i in range(n):
	cnt.append(cnt[i]+l[i])


for i in range(n+1):
	if cnt[i] > x:
		print(i)
		exit()

Submission status: Wrong Answer

Solution code:
from sys import stdin
n, x = map(int, input().split())
l = [int(x) for x in stdin.readline().rstrip().split()]
cnt =[]
c = 0
cnt.append(0)
for i in range(n):
	cnt.append(cnt[i]+l[i])


for i in range(n+1):
	if cnt[i] > x:
		print(c)
		exit()
	c+=1

Submission status: Wrong Answer

Solution code:
N, X = map(int, input().rstrip().split())
li = [int(_) for _ in input().rstrip().split()]

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

print(count)

Submission status: Wrong Answer

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

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

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):
#  print (i, D, L[i])
  D += L[i]
  if D > X:
    print (i+1)
    break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
[N, X] = map(int, input().split())
Ls = list(map(int, input().split()))

D = 0
for i in range(len(Ls)):
    D = D + Ls[i]
    if D > X:
        break

print(i + 1)

Submission status: Wrong Answer

Solution code:
[N, X] = map(int, input().split())
Ls = list(map(int, input().split()))

D = 0
for i in range(len(Ls)):
    D = D + Ls[i]
    if D > X:
        print(i+1)
        break

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+1):
    if d[i]<=x:
        cnt += 1
    else:
        print(cnt)
        break

Submission status: Wrong Answer

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


def solve(N: int, X: int, L: "List[int]"):
    d_arr = []    
    for i in range(N + 1):
        if i == 0:
            d_arr.append(0)
        else:
            d_arr.append(d_arr[i - 1] + L[i - 1])
        if d_arr[i] > X:
            print(i)
            return
    return


# Generated by 1.1.4 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: Wrong Answer

Solution code:
n,x = map(int,input().split())
if n != 1:
  l = list(map(int,input().split()))
  i = 0
  cnt = 0
  ans = 0
  while cnt <= x :
    ans += 1
    cnt += l[i]
    i += 1
    if i == n-1:
      print(n+1)
      exit()
  print(ans)
else:
  l = int(input())
  if l <= x:
    print(2)
  else:
    print(1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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 = D + L[i]
  if D > X:
    ans = i+1
    break
print(ans)

Submission status: Wrong Answer

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

D, count = 0, 0
while D<=X and count<N:
    D = D+L[count]
    count += 1
print(count)

Submission status: Wrong Answer

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

if (i==n):
    ans += n
print(ans)

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

Solution code:
n,x,*l=map(int,open(0).read().split())

l.insert(0,0)
total=0
for i, l_ in enumerate(l, start=1):
  total+=l_
  if total <= x:
    pass
  else:
    break
print(i-1)

Submission status: Wrong Answer

Solution code:
n,x,*l=map(int,open(0).read().split())

l.insert(0,0)
total=0
for i, l_ in enumerate(l, start=1):
  total+=l_
  if total <= x: pass
  else:          break
print(i-1)

Submission status: Wrong Answer

Solution code:
import math


inputa = input().split()
inputb = input().split()

a = int(inputa[0])
b = int(inputa[1])
# c = int(inputa[2])

# x = int(inputb[0])
# y = int(inputb[1])

# inputList=[]
# for i in range(a):
#     inputNum = input()
#     inputList.append(inputNum)

listb = []
listb = [int(n) for n in inputb]

sum = 0
cnt = 0

for i in range(a):
    sum += listb[i]
    if sum < b:
        cnt = i + 1
    else:
        break
        
print(cnt)

Submission status: Wrong Answer

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

cnt=1
dist=0

for l in L:
  cnt+=1
  dist+=l
  if dist>=X:
    break
    
print(cnt)

Submission status: Wrong Answer

Solution code:
n,x = map(int,input().split())
*l, = map(int,input().split())
r = 0
ans =0
for i in l:
  if x>= r:
    ans += 1
  r += i
print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

bounds = 1
prev = 0
for i in range(1,N):
    bi = prev + L[i-1]
    prev = bi
    if bi > X:
        break
    else:
        bounds += 1

print(bounds)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(count)

Submission status: Wrong Answer

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

total = 0

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

    if total > X:
        break

print(i + 1)

Submission status: Wrong Answer

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

num = 0
for i in range(N):
    new_list = L[0:i]
    if sum(new_list) <= X:
        num += 1
    else:
        num += 0
print(num)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

D = [0]*(n+1)
for i in range(n):
    D[i+1] = D[i]+L[i]
    if D[i+1] > x:
        print(i+1)
        break
print(n+1)

Submission status: Wrong Answer

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

D = [0]*(n+1)
for i in range(n):
    D[i+1] = D[i]+L[i]
    if D[i+1] > x:
        print(i+1)
        break

Submission status: Wrong Answer

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

if __name__ == '__main__':
    N, X = map(int,input().split())
    L    = list(map(int,input().split()))

    print(bounding(N,X,L))

Submission status: Wrong Answer

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

D=[0]*N

D[0]=0
count=1
for i in range(1,N):
  D[i]=D[i-1]+L[i-1]
  if D[i]<=X:
    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]*(N-1)

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