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

print(n)

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

Submission status: Wrong Answer

Solution code:
N,X = map(int,input().split())
Li = list(map(int,input().split()))	
SUM = 0
for i in range(N):
  SUM += Li[i]
  if SUM > X:
    print(i+1)
    SUM -= 1000

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
import sys

#imgur.com/Pkt7iIf.png

#n, m = map(int, input().split())
#n = int(input())
#d = list(map(int, input().split()))

n, x = map(int, input().split())
d = list(map(int, input().split()))
r = s = 0

for i, p in enumerate(d):
    if s > x:
        exit(print(i))
        break
    else:
        s += p
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:
    print(i+1)
    break
  if D == X:
    print(i+2)
    break
print(i+2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
# 行数を取得
import sys
list=[]
for line in sys.stdin:
    list.append(line)

NandX=list[0].split()

N=int(NandX[0])
X=int(NandX[1])

L=list[1].split()
D=0
i=0

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

Submission status: Wrong Answer

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

D=0
c=1

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

print(c)

Submission status: Wrong Answer

Solution code:
nx = input().split(' ')
n = int(nx[0])
x = int(nx[1])

l = input().split(' ')
d = 0
bound = 0
for i in range(n):
  if d<=x :
    bound += 1
  else:
    break
  d = d + int(l[i])

print(bound)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n, x = map(int, input().split())
l = list(map(int, input().split()))
count = 0
for a in l:
  count += 1
  if(x-a) < 0:
    break

print(count)

Submission status: Wrong Answer

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

print(i)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a,b=input().split()
d=0
n=0
l=input().split( )
for q in range(int(a)):
  if d>int(b):
    break
  if d==int(b):
    q+=1
    break
  else:
    w=l[q]
    d+=int(w)

print(q)

Submission status: Wrong Answer

Solution code:
a,b=input().split()
d=0
n=0
l=input().split( )
for q in range(int(a)):
  if d>int(b):
    break
  else:
    w=l[q]
    d+=int(w)
    n+=1
print(n)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

bound = 0
ans = 1

for i in d:
    bound += i
    if bound >x:
        break
        ans += 1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

total = 0
for i, l in enumerate(l_list):
    total += l
    if total > x:
        break
print(i+1)

Submission status: Wrong Answer

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

total = 0
for i, l in enumerate(l_list):
    total += l
    if total >= x:
        break
        print(i+1)
        sys.exit()
print(i+1)

Submission status: Wrong Answer

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

total = 0
for i, l in enumerate(l_list):
    total += l
    if total > x:
        break
        print(i+1)
        sys.exit()
print(i+1)

Submission status: Wrong Answer

Solution code:
[n,x]=[int(_) for _ in input().split()]
li=[int(_) for _ in input().split()]
d=0
for i in range(len(li)):
  if d>x: 
    print(i)
    break
  d+=li[i]

Submission status: Wrong Answer

Solution code:
import sys
input=sys.stdin.readline
def main():
    n,x=map(int,input().split())
    l=list(map(int,input().split()))
    q=[0]*(n+1)
    for i in range(1,n+1):
        q[i]=q[i-1]+l[i-1]
    def bs(x):
        l=0 ; r=n-1
        while l<=r :
            m=(l+r)>>1
            if q[m] <= x :l=m+1
            else : r=m-1
        return l
    print(bs(x))
main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

i,D=1,0

if sum(L)<=X:
    print(N+1)
else:
    while 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()))

ans,i,D=0,1,0

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

Submission status: Wrong Answer

Solution code:
N,X=[int(x) for x in input().split(' ')]
arr=[int(x) for x in input().split(' ')]
temp=0
for x in range(N):
  if arr[x]+temp>X:
    temp=x
    break
  else:
    temp+=arr[x]
print(temp+1)

Submission status: Wrong Answer

Solution code:
N,X=[int(x) for x in input().split(' ')]
arr=[int(x) for x in input().split(' ')]
temp=0
for x in range(N):
  if arr[x]+temp>X:
    temp=x
    break
  else:
    temp+=arr[x]
print(temp)

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):
    d += l

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

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split(" "))
ar = list(map(int,input().split(" ")))
ar.insert(0,0)
c = 0
ans = 0
for r in ar:
    c += r
    if c <= b:
        ans += 1
    else:
        print(ans)
        exit()

Submission status: Wrong Answer

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

d = 0

for i, l_ in enumerate(l):
	d += l_
	if d > x:
		break
		
print(i)

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split(" "))
ar = list(map(int,input().split(" ")))
c = 0
ans = 0
for r in ar:
  if c <= b:
    ans += 1
  else:
    print(ans)
    exit()
  c += r

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
#ABC130 B

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

D = [0]
for i, l in enumerate(L):
  D.append(D[i] + L[i])
  
for i, d in enumerate(D):
  if d > X:
    print(i)
    break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if x == X:
    count += 1
 
print(count)

Submission status: Wrong Answer

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

x = 0
count = 0

while x <= X and count < N:
    x += int(steps[int(count)])
    count += 1

print(count)

Submission status: Wrong Answer

Solution code:
import logging

logging.basicConfig(level=logging.INFO, format="%(message)s")
logging.disable(logging.CRITICAL)

N, X  = (int(x) for x in input().split())
L = list(int(x) for x in input().split())

logging.info(L)

length = 0
counter = 1

for i in L:
    length += i
    if length > X or counter == N - 1:
        break
    counter += 1
    
print(counter)

Submission status: Wrong Answer

Solution code:
import logging

logging.basicConfig(level=logging.INFO, format="%(message)s")
logging.disable(logging.CRITICAL)

N, X  = (int(x) for x in input().split())
L = list(int(x) for x in input().split())

logging.info(L)

length = 0
counter = 1

if X < L[0]:
    print(1)
else:
    for i in L:
        length += i
        if length >= X or counter == N:
            break
        counter += 1
    
    print(counter)

Submission status: Wrong Answer

Solution code:
import logging

logging.basicConfig(level=logging.INFO, format="%(message)s")
logging.disable(logging.CRITICAL)

N, X  = (int(x) for x in input().split())
L = list(int(x) for x in input().split())

logging.info(L)

length = 0
counter = 1

if X < L[0]:
    print(1)
else:
    for i in L:
        length += i
        if length > X or counter == N:
            break
        counter += 1
    
    print(counter)

Submission status: Wrong Answer

Solution code:
import logging

logging.basicConfig(level=logging.INFO, format="%(message)s")
logging.disable(logging.CRITICAL)

N, X  = (int(x) for x in input().split())
L = list(int(x) for x in input().split())

logging.info(L)

length = 0
counter = 1
if X < L[0]:
    print(0)
else:
    for i in L:
        length += i
        if length > X or counter == N:
            break
        counter += 1
       
    print(counter)

Submission status: Wrong Answer

Solution code:
import logging

logging.basicConfig(level=logging.INFO, format="%(message)s")
logging.disable(logging.CRITICAL)

N, X  = (int(x) for x in input().split())
L = list(int(x) for x in input().split())

logging.info(L)

length = 0
counter = 1

for i in L:
    length += i
    if length > X or counter == N:
        break
    counter += 1
       
print(counter)

Submission status: Wrong Answer

Solution code:
import logging

logging.basicConfig(level=logging.INFO, format="%(message)s")
logging.disable(logging.CRITICAL)

N, X  = (int(x) for x in input().split())
L = list(int(x) for x in input().split())

logging.info(L)

length = 0
counter = 0

for i in L:
    length += i
    counter += 1
    if length > X or counter == N:
        break
       
print(counter)

Submission status: Wrong Answer

Solution code:
import logging

logging.basicConfig(level=logging.INFO, format="%(message)s")
logging.disable(logging.CRITICAL)

N, X  = (int(x) for x in input().split())
L = list(int(x) for x in input().split())

logging.info(L)

length = 0
counter = 0

for i in L:
    length += i
    counter += 1
    if length > X or counter == N + 1:
        break
       
print(counter)

Submission status: Wrong Answer

Solution code:
import logging

logging.basicConfig(level=logging.INFO, format="%(message)s")
logging.disable(logging.CRITICAL)

N, X  = (int(x) for x in input().split())
L = list(int(x) for x in input().split())

logging.info(L)

length = 0
counter = 0

for i in L:
    length += i
    counter += 1
    if length >= X:
        break
       
print(counter)

Submission status: Wrong Answer

Solution code:
import logging

logging.basicConfig(level=logging.INFO, format="%(message)s")
logging.disable(logging.CRITICAL)

N, X  = (int(x) for x in input().split())
L = list(int(x) for x in input().split())

logging.info(L)

length = 0
counter = 0

for i in L:
    length += i
    counter += 1
    if length > X:
        break
       
print(counter)

Submission status: Wrong Answer

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

count = 0
c = 0
d = 0
for c in l :
    if (x >= d) :
        d = d + c
        count = count + 1
    else:
        break   

print(count)

Submission status: Wrong Answer

Solution code:
n,x=map(int,input().split())
lis = list(map(int,input().split()))
cur = 0
res = 0
for i in range(len(lis)):
    cur = cur + lis[i]
    if cur <= x:
        continue
    print(i+1)
    break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# submission # - User: herp_sy
# https://atcoder.jp/contests/

import math
import statistics

n,x = map(int, input().split())
d = []
l = list(map(int, input().split()))
cnt = 0

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

print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

tmp=0
for i,element in enumerate(L):
	tmp+=element
	if tmp>X:
		print(i+1)
		break;
	if i==N-1:
		print(N)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

s = 0
c = 0

for item in list:
    c += 1
    if (s + int(item)) <= b:
        s += int(item)
    else:
        break

print(c)

Submission status: Wrong Answer

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

s = 0
c = 0

for item in range(a):
    c += 1
    if (s + int(item)) <= b:
        s += int(item)
    else:
        break

print(c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#abc130b
import sys

n,x=map(int,raw_input().split())
l=map(int,raw_input().split())
temp=0
for i in xrange(n):
 temp+=l[i]
 if temp>x:
  print i+1
  sys.exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(c)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


if __name__ == '__main__':
    n, x = list(map(int, input().split()))
    l = list(map(int, input().split()))

    cnt = 0
    tmp = 0

    for i in l:
        if tmp > x:
            break
        tmp += i
        cnt += 1
    print(cnt)

Submission status: Wrong Answer

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


if __name__ == '__main__':
    n, x = list(map(int, input().split()))
    l = list(map(int, input().split()))

    cnt = 0
    tmp = 0

    for i in l:
        if tmp > x:
            break
        tmp += i
        cnt += 1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,x = map(int,input().split())
l = [int(i) for i in input().split()] 
ct = 0
num=0
for item in l:
  ct+=1
  num+=item
  if(num > x):
  	break;

print(ct)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n, x = map(int, input().split())
l = map(int, input().split())
init = 0
now = init
bound = 0
for l_i in l:
  if now <= x:
    now += l_i
    bound += 1

print(bound)

Submission status: Wrong Answer

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

L_n = []
N, X = map(int, input().split())

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

Lsum = 0
cnt = 0
for i in range(N):
    if Lsum <= X:
        cnt += 1
        Lsum += L_n[i]

print(cnt)

Submission status: Wrong Answer

Solution code:
n, x = map(int, input().split())
l = map(int, input().split())
init = 0
now = init
bound = 0
for l_i in l:
  if now > x:
    break
  now += l_i
  bound += 1
print(bound)

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):
    print(D[i - 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:
# -*- coding: utf-8 -*-

L_n = []
N, X = map(int, input().split())
L_n = list(map(int, input().split()))

Lsum = 0
cnt = 0
for i in range(N):
    if Lsum > X:
        break
    else:
        cnt += 1
        Lsum += L_n[i]

print(cnt)

Submission status: Wrong Answer

Solution code:
inp = input().split(" ")
n = int(inp[0])
x = int(inp[1])
l = input().split(" ")
d = 0
count = 1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
inp = input().split(" ")
n = int(inp[0])
x = int(inp[1])
l = input().split(" ")
d = 0
i = 0

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

Submission status: Wrong Answer

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

count = 1
d = 0

while d <= X and count < N:
    d += L[count-1]
    count += 1

print(count)

Submission status: Wrong Answer

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

count = 1
i  = 0
d = 0

while d <= X and count < 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()))

ans = 1 #位置0も1にカウントするから
p = 0 #今のポジション
for i in range(N):
    p += L[i]
    if p <= X:
         ans += 1
    else:
        print(ans)
        break

Submission status: Wrong Answer

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

count  = 0
d = 0

while d <= X and count < N:
    d += L[count]
    count += 1

print(count)

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)

Submission status: Wrong Answer

Solution code:
inp=input().split(' ')
L=input().split(' ')
n=int(inp[0])
l=0;
count=1;
for i in range(n):
  l+=int(L[i])
  if l<=int(inp[1]):
    count+=1
  else:
    print(count)
if count==n+1 and l<=int(inp[1]):
    print(n+1)

Submission status: Wrong Answer

Solution code:
# B - Bounding
# https://atcoder.jp/contests/abc130/tasks/abc130_b

"""

数直線上でボールは何回跳ねるか？
nums = [3,4,5]
1回目は座標D1
Di = D[i - 1] + L[i - 1]

D2 = D[2-1](1) + L[2-1](3) = 4

D3 = D[3-1](2) + L[3-1](4) = 6
"""

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

# X = 7
# N = 3
# nums = [3, 4, 5]

ans = 0
cnt = 1

nn = [0]
for i in range(1, N):
    nn.append(nn[i - 1] + nums[i])

# print(nn)
for i in range(1, N):
    if nn[i] <= X:
        cnt += 1

print(cnt)

# for i in nums:
#     print(ans)
#     if ans + i <= X:
#         ans = ans + i
#         cnt += 1
#
# print(cnt)

Submission status: Wrong Answer

Solution code:
inp=input().split(' ')
L=input().split(' ')
n=int(inp[0])
l=0;
count=1;
for i in range(n):
  l+=int(L[i])
  if l<=int(inp[1]):
    count+=1
  else:
    print(count)
if count==n+1 and l>int(inp[1]):
    print(n)

Submission status: Wrong Answer

Solution code:
inp=input().split(' ')
L=input().split(' ')
n=int(inp[0])
l=0;
count=1;
for i in range(n):
  l+=int(L[i])
  if l<=int(inp[1]):
    count+=1
  else:
    print(count)
if count==n+1 and l>int(inp[1]):
    print(n+1)

Submission status: Wrong Answer

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

ans = 0
count_n = 1
for n in range(N):
    ans += L[n]
    if ans > X:
        count_n += 1

print(count_n)

Submission status: Wrong Answer

Solution code:
inp=input().split(' ')
L=input().split(' ')
n=int(inp[0])
l=0;
count=1;
for i in range(n):
  l+=int(L[i])
  if l<=int(inp[1]):
    count+=1
  else:
    print(count)
if count==n+1:
  print(n+1)

Submission status: Wrong Answer

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

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

print(i + 1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
inp=input().split(' ')
L=input().split(' ')
n=int(inp[0])
l=0;
count =0;
for i in range(n):
  if l<=int(inp[1]):
    count+=1;
    l+=int(L[i])
  else:
    print(count)

Submission status: Wrong Answer

Solution code:
inp=input().split(' ')
L=input().split(' ')
n=int(inp[0])
l=0;
count =0;
for i in range(n):
  if l<=int(inp[1]):
    count+=1;
    l+=int(L[i])
  else:
    print(count)
if count==n+1:
  print(n+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])
    d=d+l[i]
print(a)
e=0
for i in range(0,len(a)):
    if a[i]<=x:
        e=e+1
print(e)

Submission status: Wrong Answer

Solution code:
inp=input().split(' ')
L=input().split(' ')
n=int(inp[0])
l=0;
count =0;
for i in range(n):
  if l<=int(inp[1]):
    count+=1;
    l+=int(L[i])
  else:
    print(count)
if count==n:
  print(n)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

n, x = map(int, input().split())
l = list(map(int, input().split()))
sum = 1
for i in range(n):
    sum += l[i]
    if sum > x:
        print(i)
        sys.exit()
print(n+1)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

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