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

Submission status: Wrong Answer

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

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 += L[i]

print(ans)

Submission status: Wrong Answer

Solution code:
def main():
    N, X = map(int, input().split())
    lst = list(map(int, input().split()))
    cnt = 0
    s = 0
    arr1 = []
    for i in range(N):
        arr1.append(s)
        s += lst[i]
    for j in range(N):
        if arr1[j] <= X:
            cnt += 1
    print(cnt)
main()

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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(1,n+1) :
    d += l[i-1]
    if d > x :
        print(i)
        sys.exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

c = 1
p = 0
for n in range(N):
  p += L[n]
  c += 1
  if p >= X:
    break
print(c)

Submission status: Wrong Answer

Solution code:
# 190616_sun_B

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

i = 2
D = 0

while D <= X: # i番目のバウンドが失敗するまでやる
    D = D + L[i-2] # i番目のバウンド位置
    if i == N:
        break
    i = i + 1

if i == N+1:
    print(i)
else:
    print(i-1)

Submission status: Wrong Answer

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

print(i-1)

Submission status: Wrong Answer

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

print(cnt)

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

Submission status: Wrong Answer

Solution code:
bt, limit = map(int, input().split())
C = [int(i) for i in input().split()]
result = []
bound = 0

for i in range(bt):
    
    if i == 0:
        result.append(bound)
    else:
        bound = bound + C[i-1]
        if bound > limit:
            break
        else:
            result.append(bound)
        
    
print(len(result))

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

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

    print(ans)

Submission status: Wrong Answer

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

print(cnt)

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

Submission status: Wrong Answer

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

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

    d_ = d
    ans += 1


print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if sum(L) < X:
  print(N)
  exit()

for i in range(N):
  jumpNumber = jumpNumber + L[i]
  if jumpNumber > X:	
  	print(i+1)
  	break
  elif jumpNumber == X:
    print(i+2)
    break
  else:
    pass

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
M = input()
l = M.split()
ll = list(map(int, l))
q=0
ans=1
for i in range(1,a):
  q += ll[i]
  if q <= b :
    ans += 1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

zahyo = 0
i = 0
while(zahyo <= x):
    
    zahyo = zahyo + li[i]
    print(zahyo)
    
    if zahyo <= x:
        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()))

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

Submission status: Wrong Answer

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

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

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

print(ans)

Submission status: Wrong Answer

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

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

h = 0  # place

for i in range(n):
    h += l[i]

    if h > x:
        print(i+1)
        break

print(i+2)

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

Submission status: Wrong Answer

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

D = 0
i = 0

for d in L:
    D += d
    i += 1
    if X < D:
        break

print(i)

Submission status: Wrong Answer

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

ans = 0
d = 0
d_ = 0
for i in range(1, n+1):
    if i == 1:
        ans += 1
        continue
    else:
        d = d_ + l[i-1]

    d_ = d
    ans += 1

    if d > x:
        break

print(ans)

Submission status: Wrong Answer

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

L = list(map(int, input().split()))
A = 0
D = 0

for i in L:
  if X < D:
    break
  else:
    D += i
    A += 1

print(A)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n,x = input().split()
list = input().split()
d = 0
i = 0
y = 0
while i < int(n):
    d = d + int(list[i])
    if d > int(x):
        y = 1
        break
    else:
        i += 1
if y == 1:
    print(i + 1)
else:
    print(int(n))

Submission status: Wrong Answer

Solution code:
import numpy as np
N, X = map(int, input().split())  
L= [int(i) for i in input().split()] 
su=0
if np.sum(L) <= X:
    print(X+1)
else:
    for i in range(len(L)):
        su = su + L[i]
        if su > 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
ans = 0

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
#a = int(input())
# スペース区切りの整数の入力
n, x = map(int, input().split())
# 文字列の入力
#s = input()
# 出力
#print("{} {}".format(a+b+c, s))

#1列複数入力
list = [int(i) for i in input().split()]

d=0
count=0
a=0
for a in range(n):
#	print(d)
	d = d + list[a]
	count=count+1
	if(d > x):
		break
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
N,X =[int(i) for i in input().split()]
L = [int(i) for i in input().split()]
D = 0
for i in range(N+1):
  if D > X:
    print(i)
    break
  elif i==N:
    print(i)
    break
  D += L[i]

Submission status: Wrong Answer

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

i = 1
D = 0

while D <= X:
    D = D + L[i-1]
    i = i + 1
    if i == N+1:
        break

if i == N+1:
    print(i-1)
else:
    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(len(l)):
    d += l[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()))
count=1
D=0
for i in range(n):
    if D>=x:
        print(count)
    else:
        D=D+L[i]     
        count+=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:
    D = D + L[i]
    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()] 
su=int()
for i in range(len(L)):
    su = su + L[i]
    if su > X:
        break
print(i+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
nx = [int(e) for e in input().split()]
ll = [int(e) for e in input().split()]

n = nx[0]   # バウンド回数
x = nx[1]   # 終点
point = 0   # バウンド位置
count = 0   # バウンド回数

# 1回目の処理を追加
if point <= x:
    count += 1

while point <= x:
    #print(count)
    #print(point)
    if count == n:
        break
    point += ll[count - 1]     # countは1以上である必要がある
    count += 1
    if point > x:
        count -= 1
        break
    # デバッグ
    #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
count = 0
if len(L) == 1:
    d += L[0]
    count += 1
    if d <= x:
        count += 1
    print(count)
else:
    for i in range(len(L)):
        d += L[i]
        count += 1
        if d > x:
            print(count)
            break
        if d == x:
            count += 1
            print(count)
            break
        if i+1 == len(L):
            print(count)

Submission status: Wrong Answer

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

jumpNumber = 0

for i in range(N):
  jumpNumber = jumpNumber + L[i]
  if jumpNumber > X:	
  	print(i+1)
  	break
  elif jumpNumber == X:
    print(i+2)
    break
  else:
    pass

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
#a = int(input())
# スペース区切りの整数の入力
n, x = map(int, input().split())
# 文字列の入力
#s = input()
# 出力
#print("{} {}".format(a+b+c, s))

#1列複数入力
list = [int(i) for i in input().split()]

d=0
count=0
for a in range(n):
#	if(a<=1):
#		y=1
#	else:
#		y=a
#	print(d)
	d = d + list[a]
	count=count+1
	if(d > x):
		break
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

d = 0
r = 0 
for (i, l) in enumerate(L):
    d = d + l 
    if d > X:
        r = i
        break
print(r+1)

Submission status: Wrong Answer

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

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

print(d)
print(count)

Submission status: Wrong Answer

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

for i in L:
    D += i
    if D <= X:
        v += 1
    else:
        print(v)
        break

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

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
#a = int(input())
# スペース区切りの整数の入力
n, x = map(int, input().split())
# 文字列の入力
#s = input()
# 出力
#print("{} {}".format(a+b+c, s))

#1列複数入力
list = [int(i) for i in input().split()]

d=0
count=0
for a in range(n):
#	if(a<=1):
#		y=1
#	else:
#		y=a
#	print(d)
	if(d >= x):
		break
	d = d + list[a]
	count=count+1
	
print(count)

Submission status: Wrong Answer

Solution code:

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



cnt = 0
x = 0
for length in L:
    #print(cnt, x)
    if x <= X:
        cnt += 1
        x += length
    else:
        break
else:
    cnt += 1

print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
i = raw_input().split(" ")
n,x = map(lambda s: int(s), i)
lst = raw_input().split(" ")

ans = 0
count = 1
for  s in lst:
    ans += int(s)
    if ans > x:
        break
    else:
        print(ans)
        count += 1


print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
#a = int(input())
# スペース区切りの整数の入力
n, x = map(int, input().split())
# 文字列の入力
#s = input()
# 出力
#print("{} {}".format(a+b+c, s))

#1列複数入力
list = [int(i) for i in input().split()]

d=0
count=0
for a in range(n):
#	if(a<=1):
#		y=1
#	else:
#		y=a
#	print(d)
	if(d > x):
		break
	d = d + list[a]
	count=count+1
	
print(count)

Submission status: Wrong Answer

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

jumpNumber = 0

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
#a = int(input())
# スペース区切りの整数の入力
n, x = map(int, input().split())
# 文字列の入力
#s = input()
# 出力
#print("{} {}".format(a+b+c, s))

#1列複数入力
list = [int(i) for i in input().split()]

d=0
count=0
for a in range(n):
#	if(a<=1):
#		y=1
#	else:
#		y=a
	print(d)
	if(d > x):
		break
	d = d + list[a]
	count=count+1
	
print(count)

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

print(count)

Submission status: Wrong Answer

Solution code:

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



cnt = 0
x = 0
for length in L:
    #print(cnt, x)
    if x <= X:
        cnt += 1
        x += length
    else:
        break

print(cnt)

Submission status: Wrong Answer

Solution code:
def li():
    return list(map(int, input().split()))


if __name__ == "__main__":
    [n, x] = li()
    l_list = li()

    bound = 0
    bound_x = 0
    index = 0
    bound = bound + 1
    while bound_x + l_list[index] <= x:
        bound = bound + 1
        index = index + 1
        if index >= len(l_list):
            break
        bound_x = bound_x + l_list[index]
    print(bound)

Submission status: Wrong Answer

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

cnt = 0
before = 0
d = 0
L.insert(0, 0)


for i in range(1, N + 1):
    d = before + L[i - 1]
    if d <= X:
        cnt += 1

    before = d

print(cnt)

Submission status: Wrong Answer

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

D = [0 for _ in range(n)]

for i in range(1, n):
  D[i] = D[i-1] + L[i-1]

res = [True if D[i] <= x else False for i in range(n)]

print(sum(res))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
i = raw_input().split(" ")
n,x = map(lambda s: int(s), i)
lst = raw_input().split(" ")

ans = 0
count = 0
for  s in lst:
    ans += int(s)
    count += 1
    if ans >= x:
        break

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

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

print(count)

Submission status: Wrong Answer

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

#print(nums)

s=0
cnt=0
for i in nums:
    s=s+i
    cnt+=1
    if s>x:
        print(cnt)
        exit()

print(x+1)

Submission status: Wrong Answer

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

ans=0

cur_X = 0
pos_N = 0
while cur_X <= X and pos_N < N:
    cur_X += L[pos_N]
    pos_N += 1
    ans += 1

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

cnt = 1
before = 0
d = 0
for i in range(2, N + 1):
    d = before + L[i - 1]
    if d <= X:
        cnt += 1

    before = d

print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

count = 1

current = 0

for l in l_list:
    current += l
    count += 1
    if current > x:
        print(count - 1)
        exit()

    print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

D=0
i=0
c=0
while D <= X:
    c+=1
    D+=l[i]
    i+=1
    if i+1>len(l):
        break

print(c)

Submission status: Wrong Answer

Solution code:
import numpy as np
N,X = map(int,input().split())
L = list(map(int,input().split()))
La = np.array(L)
Lcs = La.cumsum()
b_count = 0
for l in Lcs:
  b_count += 1
  if X < l:
    break
print(b_count)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,X=map(int,input().split())
L=list(map(int,input().split()))
T=0
if sum(L) <= X:
  print(N+1)
else:
  for l,i in zip(L,range(N)):
    T=T+l
    if T >= X:
      print(i+1)
      break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
i = raw_input().split(" ")
n,x = map(lambda s: int(s), i)
lst = raw_input().split(" ")

ans = 0
count = 0
for  s in lst:
    ans += int(s)
    count += 1
    if ans > x:
        break

print(count)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import numpy as np
N,X = map(int,input().split())
L = list(map(int,input().split()))
Lcs = np.array(L)
b_count = 0
for l in Lcs:
  b_count += 1
  if X <= l:
    break
print(b_count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

#print(nums)

s=0
cnt=0
for i in nums:
    s=s+i
    cnt+=1
    if s>x:
        break
print(cnt)

Submission status: Wrong Answer

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

while d<=x:
   if len(l)<=k:
    break
   else:
    d=d+l[k]
    k=k+1
if d<x:
  print(k+1)
else:print(k)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = list(map(int, input().strip().split(' ')))
L = list(map(int, input().strip().split(' ')))

D = [0] * (s[0] + 1)
count = 0

for i in range(1, s[0] + 1):
    if (s[1] >= D[i - 1]):
        D[i] = D[i - 1] + L[i - 1]
        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
cnt = 0
for i in range(n):
    d = d + l[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()))
d = 0

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

if d > X and d-L[len(L)-1]<=X:
    print(N)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

x = 0
cnt = 0

for length in L:
    cnt += 1
    x += length
    if x > X:
        break

print(cnt)

Submission status: Wrong Answer

Solution code:
import numpy as np
N,X = map(int,input().split())
L = list(map(int,input().split()))
Lcs = np.array(L)
b_count = 0
for l in Lcs:
  b_count += 1
  if X < l:
    break
print(b_count)

Submission status: Wrong Answer

Solution code:
nx = [ int(x) for x in input().split(" ")]
ln = [ int(x) for x in input().split(" ")]
sum = 0
for i in range(nx[0]):
    sum += ln[i]
    if sum > nx[1]:
        break
print(i + 1)

Submission status: Wrong Answer

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

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


for i in range(n):
   if x > sum(w[:i+1]):
      next
   elif x == sum(w[:i+1]):
      print(i+2)
      break
   elif x < sum(w[:i+1]):
      print(i+1)
      break
   else:
      print(0)
      break

Submission status: Wrong Answer

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

x = 0
cnt = 0

for length in L:
    cnt += 1
    x += length
    print(cnt, x)
    if x > X:
        break

print(cnt)

Submission status: Wrong Answer

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