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 = list(map(int, input().split()))
L = list(map(int, input().split()))
# S = [list(map(int, input().split())) for i in range(n)]

Di = 0
for i, l in enumerate(L):
    Di += l
    if Di >= x:
        print(i + 1)
        break
else:
    print(i + 1)

Submission status: Wrong Answer

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

Di = 0
for i, l in enumerate(L):
    Di += l
    if Di > x:
        print(i + 1)
        break
else:
    print(i + 1)

Submission status: Wrong Answer

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

Di = 0
for i, l in enumerate(L):
    Di += l
    if Di > x:
        print(i + 1)
        break
else:
    print(i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x=int(input().split()[1])
l=[int(x) for x in input().split()]
s=[1 for i in [0]*len(l) if sum(l[:i])<=x]
print(sum(s))

Submission status: Wrong Answer

Solution code:
# 2つの入力を空白で分割し、数値化
n, x = map(int, input().split())

# 空白区切りの数値をリスト化
l = map(int, input().split())

distance = 0
result = 0

for d in l:
    if x < distance:
        print(result)
    else:
        distance += d
        result += 1

Submission status: Wrong Answer

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

zahyou = 0
num = 1

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

Submission status: Wrong Answer

Solution code:
s=input().split()
n=int(s[0])
x=int(s[1])
j=[]
d=input().split()
for i in range(n):
    j.append(int(d[i]))
d= 0
i=0
p=0
while d<=x and i<=len(j)-1:
    p+=1
    d+=j[i]
    i+=1
print(p)

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

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

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

Submission status: Wrong Answer

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

while now <= x:
    now += l[i]
    i += 1
    if i >= len(l):
        i += 1
        break
    
print(i)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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


g = 0
cnt = 1
for l in L:
    g += l
    if X <= g:
        break
    cnt += 1

print(cnt)

Submission status: Wrong Answer

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



g = 0
cnt = 0
for l in L:
    g += l
    if X < g:
        break
    cnt += 1

print(cnt)

Submission status: Wrong Answer

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

print("N:{},X:{}".format(N, X))
print(L)

g = 0
cnt = 0
for l in L:
    g += l
    if X < g:
        break
    cnt += 1

print(cnt)

Submission status: Wrong Answer

Solution code:
N,X=list(map(int,input().split()))
i=list(map(int,input().split()))
listD=[0]
d=0

for s in i:
	d=d+s
	if d < X:
		listD.append(d)
        
print(len(listD))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

zahyo = 0
count = 1

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

Submission status: Wrong Answer

Solution code:
d=0
c=0

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

for j in range(len(l)):
    if d<=x:
        d+=int(l[j])
        c+=1 

print(c)

Submission status: Wrong Answer

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

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

D = [0 for i in range(N+1)]

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

Submission status: Wrong Answer

Solution code:
alfa=input().split()
N=int(alfa[0])
X=int(alfa[1])
#L=[int(input().split()) for i in range(N)]
L=input().split()

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

if D<X:
    print(count)

Submission status: Wrong Answer

Solution code:
alfa=input().split()
N=int(alfa[0])
X=int(alfa[1])
#L=[int(input().split()) for i in range(N)]
L=input().split()

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

if D<X:
    print(count)

Submission status: Wrong Answer

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

line = list(input().split(" "))

total = 0
ans = 0
for i in range(n):
    if total > x:
        break
    else:
        total += int(line[i])
        ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
alfa=input().split()
N=int(alfa[0])
X=int(alfa[1])
#L=[int(input().split()) for i in range(N)]
L=input().split()


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

Submission status: Wrong Answer

Solution code:
alfa=input().split()
N=int(alfa[0])
X=int(alfa[1])
#L=[int(input().split()) for i in range(N)]
L=input().split()


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

Submission status: Wrong Answer

Solution code:
alfa=input().split()
N=int(alfa[0])
X=int(alfa[1])
#L=[int(input().split()) for i in range(N)]
L=input().split()


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

Submission status: Wrong Answer

Solution code:
alfa=input().split()
N=int(alfa[0])
X=int(alfa[1])
#L=[int(input().split()) for i in range(N)]
L=input().split()


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

Submission status: Wrong Answer

Solution code:
alfa=input().split()
N=int(alfa[0])
X=int(alfa[1])
#L=[int(input().split()) for i in range(N)]
L=input().split()


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

Submission status: Wrong Answer

Solution code:
alfa=input().split()
N=int(alfa[0])
X=int(alfa[1])
#L=[int(input().split()) for i in range(N)]
L=input().split()


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

Submission status: Wrong Answer

Solution code:
alfa=input().split()
N=int(alfa[0])
X=int(alfa[1])
#L=[int(input().split()) for i in range(N)]
L=input().split()


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

Submission status: Wrong Answer

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

for i in l:
	if far+i<=x:
		far += i
		count+=1
	# if far > x:
	# 	break

print(count)

Submission status: Wrong Answer

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

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

print(count)

#超えた分の回数は含めてはいけないが、距離0のバウンドをカウントしていないので相殺

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=0
x=0
l=[]
d=0
c=0

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

n=all_input[0]
x=all_input[1]

for i in range(2,len(all_input)):
    l.append(all_input[i])

for j in range(len(l)):
    if d<=x:
        d+=l[j]
        c+=1 

print(c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, X = map(int, input().split())
LA = list(map(int, input().split()))
DA = [0] * (N + 1)

for nn in range(1, N + 1):
    DA[nn] = DA[nn - 1] + LA[nn - 1]

cc = 0
for i, d in enumerate(DA):
    if d < X:
        cc = i + 1  
    else:
        break

print(cc)

Submission status: Wrong Answer

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

CC = 0
LL = 0
for nn in range(N):
    LL += LA[nn]
    if LL > X:
        break
    CC += 1

print(CC)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
d = 0
e = 0
for i in list(map(int, input().split())):
    if d > b:
        break
    e += 1
    d += i
print(e)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
d = 0
e = 0
for i in list(map(int, input().split())):
    if d > b:
        break
    else:
        e += i
    d += i
print(e)

Submission status: Wrong Answer

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

d = 0
e = 0
for i in range(a):
    if d <= b:
        e += 1
    else:
        break
    d += c[i]
print(e)

Submission status: Wrong Answer

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

d = 0
e = 0
for i in range(a):
    if d <= b:
        e += 1
    d += c[i]
print(e)

Submission status: Wrong Answer

Solution code:
N, X = map(int, input().split())
n = 0
ret = 0
for x in [int(x) for x in input().split()]:
    ret += 1
    n += x
    if n > X:
        break
print(ret)

Submission status: Wrong Answer

Solution code:
N, X = map(int, input().split())
n = 0
ret = 0
for x in [int(x) for x in input().split()]:
    if n > X:
        break
    ret += 1
    n += x
print(ret)

Submission status: Wrong Answer

Solution code:
n, x = input().split()
l_list = input().split()
l = 0
ans = 0
y = []
for i in range(0, int(n)):
  y.append(l)
  l += int(l_list[i]) 
for yy in y:
    if yy <= int(x):
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
n, x = input().split()
l_list = input().split()
i = 0
ans = 0
y = 1
for l in l_list:
    if i > int(x):
        print(ans)
        y = 0
        sys.exit()
    i += int(l)
    ans += 1
if y:
  print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, limit = map(int, input().split())
bounce = input().split()
b = [0]
count = 0
for i in range(len(bounce)):
  b.append(b[i]+i)
  
for j in range(len(b)):
  if b[j] <= limit:
    count += 1
print(count)

Submission status: Wrong Answer

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

cur, index, ans = 0, 0, 0

for i in ar:
    cur += i

    if cur <= x:
        ans += 1

print(ans)

Submission status: Wrong Answer

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

cur, index, ans = 0, 0, 0

while cur <= x and index < n:
    cur += ar[index]
    index += 1
    ans += 1

print(ans)

Submission status: Wrong Answer

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

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

print(count)

Submission status: Wrong Answer

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

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

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,X=map(int,input().split())
L=list(map(int,input().split()))
l=0
for i in range(len(L)):
  if l<X:
    l+=L[i]
    if l==X:
      print(i+2)
      exit()
  else:
    print(i)
    exit()

Submission status: Wrong Answer

Solution code:
import sys

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

for i,l in enumerate(L):
    z = z+l
    if z>X:
        print(i+1)
        exit()
print(N)

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

d=0

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

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

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

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

Submission status: Wrong Answer

Solution code:
def solve():
    N, X = [int(s) for s in input().split() if s]
    L = [int(s) for s in input().split() if s]
    D = 0
    cnt = 0
    for l in L:
        # print(D)
        D += l
        cnt += 1
        if D > X:
            break
    print(cnt)

solve()

Submission status: Wrong Answer

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

c = 0

for i in range(n):
    if sum(L[:i+1]) <= x:
        c += 1
print(c)

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
lis = list(map(int,input().split()))
ans = 1
now = 0
for num in lis:
  now += num
  if now > m:
    exit()
  else:
    ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
goukei=0 
count=1

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

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

Submission status: Wrong Answer

Solution code:
goukei=0 
count=0

N,X =map(int, input().split())
L= list(map(int, input().split()))
    
while(goukei < X):
    for i in range(N-1):
        goukei +=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(1,n):
    d.append(d[i-1]+l[i-1])
    if sum(d) <=x:
        print(d)
    else:
        break

print(len(d))

Submission status: Wrong Answer

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

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

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

flag = True
for i in range(len(D)):
    if D[i] > X:
        print(i)
        flag = False
        break

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


def main():
    n, x = map(int, input().split())
    lst = list(map(int,input().split()))
    lst = lst[:n]
    print(n, x)
    print(lst)

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

    bound = 0

    for n, i in enumerate(d):
        if i <= x:
            bound += 1
        else:
            break
    print(bound)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

if a[0] > x:
    print(0)
else:
    while cnt <= x:
        cnt += a[i]
        i += 1
        if i == n:
            break
    print(i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

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

lst_A = ["0"]

lst_A.extend(input().split())

count = 0

dis = 0

for i in range(N):
    dis += int(lst_A[i])
    if dis <= X:
        count += 1

print(count)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 25 12:46:40 2019

@author: YudNK
"""

n,x = map(int, input().split())
l = [int(i) for i in input().split()]
count = 1
px = 0
for i in range(n):
    nx = px + l[i]
    if nx <= 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()]
m=[0]
for i in range(n):
    m.append(m[i]+l[i])
a=0
for i in range(n):
    a+=l[i]
    if a>x:
        ans=i+1
    else:
        ans=n+1
print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(count)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
N, X = map(int, input().split())
l_list = list(map(int, input().split()))
d = 0
for i, l in enumerate(l_list):
    if d + l > X:
        break
    d += l
print(i + 1)

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

Submission status: Wrong Answer

Solution code:
import numpy as np

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

L = np.array(L)
D = np.zeros(N+1)
count = 0

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

Submission status: Wrong Answer

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

point = 0
count = 0
while point <= x:
    point = point + l[count]
    count += 1
    if len(l) <= count:
        break

print(count)

Submission status: Wrong Answer

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

for i, d in enumerate(sp.cumsum(l)):
    if d > x:
        print(i+1)
        break
if sp.cumsum(l)[n-1] < x:
    print(n+1)

Submission status: Wrong Answer

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

for i, d in enumerate(sp.cumsum(l)):
    if d > x:
        print(i+1)
        break

Submission status: Wrong Answer

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

d = 0
count = 0

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

Submission status: Wrong Answer

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

d = 0
count = 0

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

Submission status: Wrong Answer

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

d = 0
count = 1

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

Submission status: Wrong Answer

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

d = 0
count = 0

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

Submission status: Wrong Answer

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

d = 0
count = 0

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

Submission status: Wrong Answer

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


d = 0
count = 0
j = 0

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

Submission status: Wrong Answer

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

d = 0
count = 0
j = 0
while d <= x:
  count =+ 1
  d = d + l[j]
  j =+ 1
  

if count < n+1:
  print(count)
else:
  print(n+1)

Submission status: Wrong Answer

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

d = 0
count = 0
j = 0
while d < x:
  count =+ 1
  d = d + l[j]
  j =+ 1
  

if count < n+1:
  print(count)
else:
  print(n+1)

Submission status: Wrong Answer

Solution code:
A, B = input().split()
C = input().split()
count = 0
step = 0
for i in range(int(A)):
  if step > int(B):
    break
  step += int(C[i])
  count += 1
print(count)

Submission status: Wrong Answer

Solution code:
A, B = input().split()
C = input().split()
count = 0
step = 0
for i in range(int(A)):
  step += int(C[i])
  if step > int(B):
    break
  count += 1
print(count)

Submission status: Wrong Answer

Solution code:
_,x=map(int,input().split())
l=list(map(int,input().split()))
tmp=0
for i,j in enumerate(l):
  tmp+=j
  if tmp>x:
    print(i+1)
    exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ret = 0
Ds = []

for i in range(N+1):
  if i==0:
    Ds.append(0)
  else:
    Ds.append(Ds[-1]+Ls[i-1])
  if Ds[-1]<=X:
    ret += 1
    continue
  else:
    print(ret)
    break

Submission status: Wrong Answer

Solution code:
nx = input().split()
l = input().split()

for i in range(0,int(nx[0])):
    nx[1] = int(nx[1]) - int(l[i])
    if int(nx[1]) < 0:
        print(i+1)
        break

Submission status: Wrong Answer

Solution code:
def load_input_int():
    return map(int, input().split())
    
N, X = load_input_int()
Ls = load_input_int()

cur_position = 0
for idx, l in enumerate(Ls):
    cur_position += l
    if cur_position > X:
        print(idx + 1)
        break

Submission status: Wrong Answer

Solution code:
#!/Library/Frameworks/Python.framework/Versions/3.5/bin/python3

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

j = 0
jx = 0
for i in range(len(l)):
    if jx > x:
        break
    j += 1
    jx += l[i]

print(j)

Submission status: Wrong Answer

Solution code:
N, X_MAX=input().split()
L = input().split()
count_i = 0
X = 0

for L_n in L:
    X += int(L_n)
    count_i += 1
    if int(X_MAX) < X:
        break
print(count_i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, X_MAX=input().split()
L = input().split()
i = 0
X = 0

while int(X_MAX) >= X and i < len(L):
    X += int(L[i])
    i+=1
print(i)

Submission status: Wrong Answer

Solution code:
N,X = [int(x) for x in input().split()] # N と　X
list_2 = [int(x) for x in input().split()]
 
sum_list = []
for i in list_2:
    if sum(sum_list) < X:
      sum_list.append(i)
    elif sum(sum_list) == X:
      print(len(sum_list) + 1)
      break
    elif sum(sum_list) > X:
      print(len(sum_list))
      break
if sum(sum_list) < X:
    print(N + 1)

Submission status: Wrong Answer

Solution code:
from sys import stdin
from collections import defaultdict

N, X = [int(x) for x in stdin.readline().rstrip().split()]
L = []
L = [int(x) for x in stdin.readline().rstrip().split()]

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

print(i)

Submission status: Wrong Answer

Solution code:
from sys import stdin
from collections import defaultdict

N, X = [int(x) for x in stdin.readline().rstrip().split()]
L = []
L = [int(x) for x in stdin.readline().rstrip().split()]

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

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

Submission status: Wrong Answer

Solution code:
from sys import stdin
from collections import defaultdict

N, X = [int(x) for x in stdin.readline().rstrip().split()]
L = []
L = [int(x) for x in stdin.readline().rstrip().split()]

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

print(i)

Submission status: Wrong Answer

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