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()))

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

Submission status: Wrong Answer

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

count = 0
dist = 0

for n in range(N):
    dist += L[n]
    count += 1
    if dist > X:
        break
    
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

cnt = 0
while D <= X and cnt < N:
	D = D + L[cnt]
	cnt += 1

print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def solve():
    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])
    print(len([x for x in D if x<=6]))

if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

Solution code:
n,x = map(int,input().split())
l = list(map(int,input().split()))
len(l)
print(abs(len(l)+1-x))

Submission status: Wrong Answer

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

a=0
for i in range(N+1):
    a+=i
    if a > X:
        ans=i
        break

print(i)

Submission status: Wrong Answer

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

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

print(t+1)

Submission status: Wrong Answer

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

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

print(i+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# 入力の取得(1行目。数値)
i = list(map(int, input().split()))

# 変数セット
boundCnt = i[0]
limit = i[1]

# 入力の取得(2行目。数値)
landpoints = list(map(int, input().split()))
#1回目のバウンド情報を加算(0座標)
landpoints.insert(0,0)
boundCnt += 1

nowCnt = 0
nowLandpoints = 0

for i in range(boundCnt):

   nowLandpoints += landpoints[i]
   nowCnt += 1
   if nowLandpoints > limit:
      break
print(nowCnt -1 )

Submission status: Wrong Answer

Solution code:
# 入力の取得(1行目。数値)
i = list(map(int, input().split()))

# 変数セット
boundCnt = i[0]
limit = i[1]

# 入力の取得(2行目。数値)
landpoints = list(map(int, input().split()))

nowCnt = 0
nowLandpoints = 0
for i in range(boundCnt):
    if nowLandpoints > limit:
        break
    nowCnt += 1
    nowLandpoints += landpoints[i]

print(nowCnt)

Submission status: Wrong Answer

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

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

print(y)

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:
        count += 1
        d += L[i]

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):
    while d <= X:
        count += 1
        d += L[i]

print(count)

Submission status: Wrong Answer

Solution code:
n,x=map(int,input().split())
l=list(map(int,input().split()))
suml=0
i=0
while x>suml:
   suml+=l[i]
   i+=1
   if i==n:
       break
print(i+1)

Submission status: Wrong Answer

Solution code:
n,x=map(int,input().split())
l=list(map(int,input().split()))
suml=0
i=0
while x>=suml:
   suml+=l[i]
   i+=1
   if i==n:
       break
print(i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for l in L:
  if tmp <= X:
    ans += 1
  else:
    break
  tmp = tmp + l

print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,X=list(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:
        break
    else:
        pass
print(i)

Submission status: Wrong Answer

Solution code:
N,X=list(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:
        break
    else:
        continue 
print(i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,X=map(int,input().split())
L=list(map(int,input().split()))
c=0
D=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= [0] + list(map(int,input().split()))

count = 1

for i in range(N):

    if L[i]+L[i+1] < X :
        count += 1
        L[i+1]+= L[i]
    
print(count)

Submission status: Wrong Answer

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

    if L[i]+L[i+1] <= X :
        count += 1
        L[i+1]+= L[i]
    
print(count)

Submission status: Wrong Answer

Solution code:
N,X=map(int,input().split())
L=list(map(int,input().split()))
count = 1
for i in range(N-1):

    if 0 + L[i] <= X:
        L[i+1]+=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 _ in range(n + 1)]
for i in range(1, n + 1):
  d[i] = d[i - 1] + l[i - 1]
for j in range(n + 1):
  if d[j] >= x:
    print(j)
    exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

x = 0
i = 0

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

Submission status: Wrong Answer

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

for i in range(n+1):
    if hplace > x:
        break
    hplace += l[i-1]

print(str(i))

Submission status: Wrong Answer

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

for i in range(n):
    if i != 0:
        if hplace > x :
            break
    hplace += l[i-1]

print(str(i+1))

Submission status: Wrong Answer

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

for i in range(n):
    if i != 0:
        if hplace >= x :
            break
    hplace += l[i-1]

print(str(i+1))

Submission status: Wrong Answer

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

for i in range(1,n+1):
    hplace += l[i-1]
    if hplace > x:
        break
print(str(i))

Submission status: Wrong Answer

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

ans=0
d=0

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

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

Submission status: Wrong Answer

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

ans=0
d=0

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

if(i==n-1):
    ans-=1
print(ans)

Submission status: Wrong Answer

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

ans=0
d=0

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
N,X=(int(x) for x in  input().split())
D=0
L=(int(x) for x in  input().split())
for j,i in enumerate(L):
   D+=i
   if D>X:
       break

print(j+1)

Submission status: Wrong Answer

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

i = 0
d = 0
while True:
    d = d + l[i]
    if d <= x:
        i += 1
    elif d > x:
        break
    
    if i == len(l) - 1:
        break
print(i + 1)

Submission status: Wrong Answer

Solution code:
N, X = map(int,input().split())
L = list(map(int,input().split()))
D = [0] * (N+1)
count = 0
D[0] = 0
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: Wrong Answer

Solution code:
import sys

n,x = map(int,input().split())
n = n+1

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

jump_L = [0]
next_jump = 0

for val in range(1,n):
    next_jump = next_jump + l_L[val-1]
    jump_L.append(next_jump)

print(jump_L)

counter = 0
for val in jump_L:
    if val <= x:
        counter += 1

print(counter)

Submission status: Wrong Answer

Solution code:
import sys

n,x = map(int,input().split())
n = n+1

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


counter = 0
next_jump = 0
for val in range(0,n):
    if next_jump <= x:
        next_jump = next_jump + l_L[val-1]
        counter += 1
    else:
        print(counter)
        sys.exit(0)
print(counter)

Submission status: Wrong Answer

Solution code:
import sys

n,x = map(int,input().split())
n = n+1

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


counter = 0
next_jump = 0
for val in range(0,n):
    #if next_jump <= x:
    if next_jump < x:
        next_jump = next_jump + l_L[val-1]
        counter += 1
    else:
        print(counter)
        sys.exit(0)

Submission status: Wrong Answer

Solution code:
import sys

n,x = map(int,input().split())
n = n+1

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


counter = 0
next_jump = 0
for val in range(0,n):
    if next_jump <= x:
        next_jump = next_jump + l_L[val-1]
        counter += 1
    else:
        print(counter)
        sys.exit(0)

Submission status: Wrong Answer

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

i = 0
D = 0

if L[0] >= X:
    print(1)
    exit()

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()))

i = 0
D = 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=L[0]
result=1
for n in range(1,N):
    if X<(D):
        break
    else:
        result+=1
        D=D+L[n]
print(result)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():

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

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

sum = 0

for i in range(2,n+2):
  if sum > x:
    break
  else:
    sum += l[i-2]
   # print(sum)

    
print(i-1)

Submission status: Wrong Answer

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

sum = 0

for i in range(2,n+2):
  if sum > x:
    break
  else:
    sum += l[i-2]
    print(sum)

    
print(i-1)

Submission status: Wrong Answer

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

sum = 0

for i in range(2,n+2):
  if sum >= x:
    break
  else:
    sum += l[i-2]
    print(sum)

    
print(i-1)

Submission status: Wrong Answer

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

sum = 0

for i in range(2,n+2):
  sum += l[i-2]
  print(sum)
  if sum >= x:
    break
    
print(i)

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

print(ans)

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

print(ans)

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

print(ans)

Submission status: Wrong Answer

Solution code:
# -*-coding: utf-8 -*-
N, X = map(int, input().split())
L = list(map(int, input().split()))
D = 0
i = 1
while D <= X:
    if i == N:
        i += 1
        break
    D += L[i-1]
    i += 1

print(i-1)

Submission status: Wrong Answer

Solution code:
# -*-coding: utf-8 -*-
N, X = map(int, input().split())
L = list(map(int, input().split()))
D = 0
i = 1
while D <= X:
    D += L[i-1]
    i += 1
    if i == N:
        i += 1
        break
print(i-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

dm = 0
count = 0

for m in range(n):
    if m >= 1:
        dm = dm + ll[m-1]
    if dm <= x:
        count = count + 1

print(count)

Submission status: Wrong Answer

Solution code:
limit = input().split()
hane = input().split()
hane = [int(i) for i in hane]

tmp = 0
ans = 0
for i in hane:
  tmp += i
  if tmp<=int(limit[1]): ans +=1
  else: break
    
print(ans)

Submission status: Wrong Answer

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

d = 0
count = 0
for i in l:
    if d >= x:
        break
    count += 1
    d += i

print(count)

Submission status: Wrong Answer

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

d = 0
count = 0
for i in l:
    if d > x:
        break
    count += 1
    d += i

print(count)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

d = [0]*n
count = 1
for i in range(1,n):
    d[i] = d[i-1] + l[i-1]
    if x >= d[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]*(n)
count = 1
for i in range(1,n):
    d[i] = d[i-1] + l[i-1]
    if x >= d[i]:
        count += 1
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#ABC130B - Bounding
N, X = list(map(int,input().split()))
l = list(map(int,input().split()))
D = [0]
x = 0
for i in range(1,N):
    x += l[i-1]
    D.append(x)

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:

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

    if(d[i]>x):
        break
    cnt += 1

print(cnt)

Submission status: Wrong Answer

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

ans = 1
dist = 0
for i in range(1, len(l)):
  dist = dist + l[i-1]
  if dist <= x:
    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):
    if D[i-1]+L[i-1] > X:
        break
    D.append(D[i-1]+L[i-1])

print(len(D) + int(D[-1] <= X))

Submission status: Wrong Answer

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

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

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

print(len(D))

Submission status: Wrong Answer

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

D = [0]
F = 0
for i in range(N):
    D.append(F+L[i])
    F = D[-1]

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

Submission status: Wrong Answer

Solution code:
n, x = map(int, input().split())
l = list(map(int, input().split()))
# n, x = 3, 6
# l = [3, 4, 5]
d = 0
i = 0
for i in range(1, n + 1):
    d = 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()))
j=0
count=0
for i in range(n):
        if j<=x:
                j=j+l[i]
                count+=1
print(count)

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):
  a+=l[i]
  ans+=1
  if a>x: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):
    if d <= x:
        d += 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()))
cnt = 0
if sum(l) <= x:
    print(n+1)
    exit()
for i in range(n):
    if cnt > x:
        break
    cnt += l[i]
print(i + 1)

Submission status: Wrong Answer

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

    if L > x:
        print(i+1)
        exit()
    else:
        continue

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()))


coordinate=0
for i in range(len(L)):
    coordinate+=L[i]
    if coordinate>x or i==len(L)-1:
        ans = i+1
        break
    
print(ans)

Submission status: Wrong Answer

Solution code:
from sys import stdin

n, x = [int(x) for x in stdin.readline().rstrip().split()]
l_lst = [int(x) for x in stdin.readline().rstrip().split()]
d = 0
count = 0

for i, l in enumerate(l_lst):
  if d > x:
    break
  else:
    count += 1
  d += l
  
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = [0]
cnt =0
for i in L:
    cnt =i + cnt
    if cnt <= X:
        ans.append(cnt)
    else:
        break
print(ans)        
print(len(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from sys import stdin

n, x = [int(v) for v in stdin.readline().rstrip().split()]
l_lst = [int(v) for v in stdin.readline().rstrip().split()]
d = 0
count = 0

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

Submission status: Wrong Answer

Solution code:
N, X = map(int, input().split())
L = list(map(int, input().split()))
count = 0
d = [0] * (N+2)
for i in range(1,N+1):
  if d[i-1] <= X:
    count += 1
  d[i] = d[i-1]+L[i-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] * (N+1)
for i in range(N):
  if d[i] <= X:
    count += 1
  d[i+1] = d[i]+L[i]
print(count)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

i=0
D=0
while(i<n and D<=x):
    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()))

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

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
ans = 1
for idx,i in enumerate(l):
    num += i
    if num > m:
        ans += idx
        break
    
print(ans)

Submission status: Wrong Answer

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

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

for i in range(len(l)):
    if num <= m:
        ct += 1
        num += l[i]
    else:
        break
    
print(ct)