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

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:break
    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(1,n):
    d += L[0]
    if d>x:break
    ans += 1
print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a=list(map(int,input().split()))
l=list(map(int,input().split()))
n=a[0]
x=a[1]
t=0
cnt=0
for k in l:
  if(t<=x):
    cnt+=1
  t+=k
print (cnt)

Submission status: Wrong Answer

Solution code:
a=list(map(int,input().split()))
l=list(map(int,input().split()))
n=a[0]
x=a[1]
t=0
cnt=0
for k in l:
  if(t<=x):
    cnt+=1
  else:
    break
  t+=k
print (cnt)

Submission status: Wrong Answer

Solution code:
a=list(map(int,input().split()))
l=list(map(int,input().split()))
n=a[0]
x=a[1]
t=0
s=[]
for k in l:
  s.append(t)
  t+=k
u=[i for i in s if i<=x]
print(len(u))

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(1, N + 1):
    D_list.append(D_list[i - 1] + L_list[i - 1])

for i in range(N + 1):
    if X < D_list[i]:
        print(i)
        exit()
    elif X == D_list[i]:
        print(i + 1)
        exit()

Submission status: Wrong Answer

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

for i in range(1, N + 1):
    D_list.append(D_list[i - 1] + L_list[i - 1])

for i in range(N):
    if X < D_list[i]:
        print(i)
        exit()
    elif X == D_list[i]:
        print(i + 1)
        exit()

Submission status: Wrong Answer

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

for i in range(1, N + 1):
    D_list.append(D_list[i - 1] + L_list[i - 1])

for i in range(N):
    if X < D_list[i]:
        print(i)
    elif X == D_list[i]:
        print(i + 1)
    else:
        print(0)

Submission status: Wrong Answer

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

for i in range(1, N + 1):
    D_list.append(D_list[i - 1] + L_list[i - 1])

for i in range(N):
    if X < D_list[i]:
        print(i)
    elif X == D_list[i]:
        print(i + 1)
    else:
      print(0)

Submission status: Wrong Answer

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

for i in range(1, N + 1):
    D_list.append(D_list[i - 1] + L_list[i - 1])

for i in range(N):
    if X < D_list[i]:
        print(i)
    elif X == D_list[i]:
        print(i + 1)

Submission status: Wrong Answer

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

for i in range(1, N + 1):
    D_list.append(D_list[i - 1] + L_list[i - 1])

for i in range(N):
    if X <= D_list[i]:
        print(i)

Submission status: Wrong Answer

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

for i in range(2, N+1):
  D.append(D[i-2] + L[i-1])

D.append(D[(N+1)-2]+L[(N)-1])
k = [i for i in D if i <= X ]

print(len(k))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

l = [num for num in map(int, input().split(' '))]

# print(n, x, l)

ans = 0
d = 0

for i in range(n):
  if d > x:
    break
  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()))

bound = 1
coordinate = 0

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

Submission status: Wrong Answer

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

coordinate = 0

for i in range(len(L)):
	coordinate += int(L[i])
	
	if coordinate > X:
		break
		
print(i+1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a=input()
b=input()
c=a.split()
d=b.split()
e=0
k=0
for i in range(len(d)):
        e+=int(d[i])
        k+=1
        if e>int(c[1]):
                break
print(k)

Submission status: Wrong Answer

Solution code:
N,X = map(int,input().split())
L = [int(x) for x in input().split()]
D = [0] * N
buf = 0
if D[0] <= X :
    buf += 1

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

Submission status: Wrong Answer

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

d = 0
count = 0
for i in range(N):
  if d <= X:
    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()))

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
def print_ans(N, X, lr):
    """Test Case
    >>> print_ans(3, 6, [3, 4, 5])
    2
    >>> print_ans(4, 9, [3, 3, 3, 3])
    4
    """
    counter = 0
    ans_sum = 0
    for l in lr:
        ans_sum += l
        if ans_sum > X:
            break
        else:
            counter += 1
    print(counter)

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

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
def print_ans(N, X, lr):
    """Test Case
    >>> print_ans(3, 6, [3, 4, 5])
    2
    >>> print_ans(4, 9, [3, 3, 3, 3])
    4
    """
    counter = 0
    ans_sum = 0
    for l in lr:
        if ans_sum > X:
            break
        counter += 1
        ans_sum += l
    print(counter)

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

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
def print_ans(N, X, lr):
    """Test Case
    >>> print_ans(3, 6, [3, 4, 5])
    2
    >>> print_ans(4, 9, [3, 3, 3, 3])
    4
    """
    counter = 1
    ans_sum = 0
    for l in lr:
        if ans_sum > X:
            break
        counter += 1
        ans_sum += l
    print(counter)

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

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
def print_ans(N, X, lr):
    """Test Case
    >>> print_ans(3, 6, [3, 4, 5])
    2
    >>> print_ans(4, 9, [3, 3, 3, 3])
    4
    """
    counter = 1
    ans_sum = 0
    for l in lr:
        if ans_sum > X:
            break
        counter += 1
        ans_sum += l
    print(ans_sum)


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

Submission status: Wrong Answer

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


d=[0]*n
for i in range(1,n):
  d[i] = d[i-1]+l[i-1]

tmp = [1 if d[i]<=x else 0 for i in range(n)]
ret=sum(tmp)

print(ret)

Submission status: Wrong Answer

Solution code:
# ABC 130: B – Bounding
n, x = [int(s) for s in input().split()]
l = [int(s) for s in input().split()]

d = 0
times = 0

while d <= x and times < n:
    d += l[times]
    times += 1

print(times if times != n else times + 1)

Submission status: Wrong Answer

Solution code:
# ABC 130: B – Bounding
n, x = [int(s) for s in input().split()]
l = [int(s) for s in input().split()]

d = 0
times = 0

while d <= x and times < n:
    d += l[times]
    times += 1

print(times)

Submission status: Wrong Answer

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

k = 0
s = 0

for i in range(n):
	if k < x:
		#print(i)
		k = k + l[i]
		s = s + 1
	else:
		pass

print(s)

Submission status: Wrong Answer

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

k = 0
s = 0

for i in range(n):
	if k <= x:
		#print(i)
		k = k + l[i]
		s = s + 1
	else:
		pass

print(s)

Submission status: Wrong Answer

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

k = 0
s = 0

for i in range(n):
	if k <= x:
		#print(i)
		k = k + l[i]
		s = i
	else:
		pass

print(s+1)

Submission status: Wrong Answer

Solution code:
n,x=(int(x) for x in input().split())
list = input().split()
list = [int(s) for s in list]
d = 0
count = 0

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

print(count)

Submission status: Wrong Answer

Solution code:
n,x=(int(x) for x in input().split())
list = input().split()
list.insert(0,0)
list = [int(s) for s in list]
z = 0
count = 0

for i in range(n+1):
    if z > x:
        break
    else:
        count = count + 1
        z = z + list[i]
        
count = count - 1
print(count)

Submission status: Wrong Answer

Solution code:
n,x=(int(x) for x in input().split())
list = input().split()
list = [int(s) for s in list]
list.insert(0,0)
z = 0
count = 0

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

Submission status: Wrong Answer

Solution code:
n,x=(int(x) for x in input().split())
list = input().split()
list = [int(s) for s in list]
list.insert(0,0)
z = 0
count = 0

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

Submission status: Wrong Answer

Solution code:
n,x=(int(x) for x in input().split())
list = input().split()
list = [int(s) for s in list]
z = 0
count = 0

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

Submission status: Wrong Answer

Solution code:
n,x=(int(x) for x in input().split())
list = input().split()
list = [int(s) for s in list]
z = 0
count = 0

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(cnt)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/python3
# -*- coding: utf-8 -*-

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 D > X:
        print(count)
        exit()
    else:
        count += 1

Submission status: Wrong Answer

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

dist, count = 0, 0
while dist <= x and count < n:
    dist += l[count]
    count += 1

print(count)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
N, X = map(int, input().split())
L = list(map(int,input().split()))

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

print(count)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
N, X = map(int, input().split())
L = list(map(int,input().split()))

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

D = 0
count = 0

while(count<len(L) and D<=x):
    D = D+L[count]
    count += 1
print(count)

Submission status: Wrong Answer

Solution code:
#%%
import sys
def input():
    return sys.stdin.readline().rstrip()

def main():
    N, X = map(int, input().split())
    L_l = [int(x) for x in input().split()]

    h = 0
    for i, l in enumerate(L_l, 1):
        h = h + l
        if h > X:
            break

    print(i)





# %%
if __name__ == '__main__':
    main()

# %%
# from atcoder_test import doTest
# doTest("abc130","b",main)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,x = map(int,input().split())
l = list(map(int,input().split()))
i=0
suml=0
if sum(l)<=x:
    print(len(l))
else:
    while suml<x:
        suml=suml+l[i]
        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
suml=0
if sum(l)<=x:
    print(len(l))
else:
    while suml<=x:
        suml=suml+l[i]
        i=i+1
    if suml>=x:
        print(i-1)
    else:
        print(i)

Submission status: Wrong Answer

Solution code:
n,x = map(int,input().split())
l = list(map(int,input().split()))
i=0
suml=0
if sum(l)<=x:
    print(len(l))
else:
    while suml+l[i]<=x:
        suml=suml+l[i]
        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
suml=0
if sum(l)<=x:
    print(len(l))
else:
    while suml<=x:
        suml=suml+l[i]
        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
suml=0
if sum(l)<x:
    print(len(l))
else:
    while suml<x:
        suml=suml+l[i]
        i=i+1
    print(i)

Submission status: Wrong Answer

Solution code:
n,x = map(int,input().split())
arr = list(map(int,input().split()))
chk = 0
cnt = 1
for i in range(len(arr)-1):
    chk = chk + arr[i]

    if chk <= x:
        cnt += 1
    else:
        print(cnt)
        exit()

print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 0
d = 0

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

print(ans)

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
from itertools import accumulate


N, X = list(map(int, input().split()))
L = list(map(int, input().split()))
L = [0] + L
L = list(accumulate(L))

for i, l in enumerate(L):
    if l > X:
        print(i)
        exit()

print(len(L)-1)

Submission status: Wrong Answer

Solution code:
from itertools import accumulate


N, X = list(map(int, input().split()))
L = list(map(int, input().split()))
L = [0] + L
L = list(accumulate(L))

for i, l in enumerate(L):
    if l > X:
        print(i)
        exit()

Submission status: Wrong Answer

Solution code:
from itertools import accumulate


N, X = list(map(int, input().split()))
L = list(map(int, input().split()))
L = [0] + L
L = list(accumulate(L))

print(L)
for i, l in enumerate(L):
    if l > X:
        print(i)
        exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def p_b():
    n, x = map(int, input().split())
    v = 0
    ans = 0
    for i in list(map(int, input().split())):
        v += i
        if v <= x:
            ans += 1
        else:
            break
    print(ans)
    
p_b()

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-1):
    cnt += L[i]
    if cnt > x:
        print(i+1)
        exit()
    elif cnt == x:
        print(i+2)
        exit()

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:
        print(i+1)
        exit()

Submission status: Wrong Answer

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

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

print (ans + 1)

Submission status: Wrong Answer

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

ptr = 0
for i in range(n):
  ptr += l[i]
  if ptr > x:
    ptr = i
    break

print (ptr + 1)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

print(count)

Submission status: Wrong Answer

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

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

print(count)

Submission status: Wrong Answer

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

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

print(count)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

    summary = 0
    index = 0
    for i in range(n):
        if summary <= x:
            summary += l[i]
            index = i+1
            if i == n-1:
                index = i+1
                break
        else:
            index = i
            print(index)
            return
    print(index)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

    summary = 0
    index = 0
    for i in range(n):
        if summary <= x:
            summary += l[i]
            index = i
            if i == n-1:
                index = i+1
                break
        else:
            index = i
            print(index)
            return
    print(index)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

    summary = 0
    for i in range(n):
        if summary <= x:
            summary += l[i]
            if i == n-1:
                print(i+1)
                return
        else:
            print(i)
            return


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

c = 1
d = 0
for i in range(0, len(L)):
  c += 1
  d += L[i-1]
  
  if d >= X:
    break
    
print(c)

Submission status: Wrong Answer

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

c = 0
d = 0
for i in range(0, len(L)):
  c += 1
  d += L[i-1]
  
  if d >= X:
    break
    
print(c)

Submission status: Wrong Answer

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

c = 0
d = 0
for i in range(0, len(L)):
  c += 1
  d += L[i-1]
  
  if d > X:
    break
    
print(c)

Submission status: Wrong Answer

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

c = 0
zahyo = 0
for i in range(len(L)):
  c += 1
  zahyo += L[i]
  
  if zahyo > X:
    break
    
print(c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,X=list(map(int,input().split()))
L=list(map(int,input().split()))
sum=0
T=True
for i in range(N):
    sum+=L[i]
    if sum>X:
        T=False
        break
if T:
    print(i+1)
else:
    print(i+2)

Submission status: Wrong Answer

Solution code:
N,X=list(map(int,input().split()))
L=list(map(int,input().split()))
sum=0
T=True
for i in range(N):
    sum+=L[i]
    if sum>X:
        break
    T=False
if T:
    print(i+1)
else:
    print(i+2)

Submission status: Wrong Answer

Solution code:
N,X=list(map(int,input().split()))
L=list(map(int,input().split()))
sum=0
T=False
for i in range(N):
    sum+=L[i]
    if sum>X:
        break
    T=True
if T:
    print(i+2)
else:
    print(i+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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