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: Runtime Error

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

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

Submission status: Runtime Error

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

X = 0
count = 0
while X <= x:
    X = X + l[count]
    count += 1
print(count)

Submission status: Runtime Error

Solution code:
def main():
    n,x = map(int, input().split())
    l = list(map(int, input().split()))
    ans = 1
    
    while True:
        i = 0
        max += l[i]
        if max < x:
            ans += 1
            
        i += 1
        
    print(ans)

main()

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
count=0
d=0
i=0
while d<=x:
    if i==0:
        d=0
        if d<=x:
            count=1
        i+=1
    elif count<=n+1:
        d=d+int(a[i-1])
        if d<=x:
            count+=1
            i+=1
    else:
        break;
print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

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:
        a = i
        break

print(str(a+1))

Submission status: Runtime Error

Solution code:
N,X=(int(x) for x in input().split())
L = input().split()
D = list()
D.append(0)
for i in range(len(L)):
    L[i] = int(L[i])

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

ans = int()
for i in range(len(D)):
    if D[i] <= X <= D[i+1] and i >= ans:
        ans = i
    else:
        pass
print(ans+1)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

for i in range(x):
  re += [numlist[i]]
  if sum(re) > x:
    re = re[:-1]
    break
    
print(len(re))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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


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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

count = 0
d = 0

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

print(count)

Submission status: Runtime Error

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

# list_l = [int(x) for x in input().split()]

position  = 0
count = 0

for i in range(N):
    position += int(input())
    if position <+ X:
        count += 1

print(count)

Submission status: Runtime Error

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

d = 0
ans = 0

for i in range(n):
    if d <= x:
        ans += 1
        d += li[i]
    else
        d += li[i]

print(ans)

Submission status: Runtime Error

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

while d<=x:
  d=d+l[k]
  k=k+1

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

d = 0
ans = 0

for i in range(n):
    if d <= x:
        ans += 1
        d += li[i]
    else
        d += li[i]

return(ans)

Submission status: Runtime Error

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

l = [int(s) for s in input().split()]
d = 0
i = 1
d = [0] * (n+1)
count = 0
if n == 1 and x >= l[0]:
    print(1)
elif n == 1 and x < l[0] :
    print(0)
else:

    while True:
        
        
        d[i] = d[i-1] + l[i-1]
        count += 1
        
        if d[i] > x:
            break
        
        i += 1
        if i > n:
            print(count)-1
            exit()

    print(count)

Submission status: Runtime Error

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

j = 1
sumL = L[0]

while sumL <= X:
    sumL += L[j]
    j += 1

print(j)

Submission status: Runtime Error

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

d=0
for i in range(n+1):
   d=d+w_list[i]
   if(d>x):
       break
   if(d>10000):
       break
   
   
print(i+1)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
N,X = [int(i) for i in input().split()]
W = []
W = list(map(int, input().split()))
count = 0
Sum = 0
while Sum <= X:
    Sum += W.pop(0)
    count += 1
print(count)

Submission status: Runtime Error

Solution code:
n, x = (int(i) for i in input().split())
l = [int(i) for i in input().split()]
count = 0
current = 0
while current <= x and  count <= n:
    current += l[count]
    count += 1
if count > n+1:
    print(n+1)
else:
    print(count)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
a = input().split(" ")
l = input().split(" ")
x = int(a[1])
y = 0
num = 1
for i in l:
    y += i
    if y <= x:
        num += 1
    else:
        break
print(num)

Submission status: Runtime Error

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

length = 0;
answer = 1;
i = 0;

while (length + l[i]) <= n[1]:
    length = length + l[i]
    answer = answer + 1
    i = i + 1

if(answer <= n[0]):
    print(answer)
else:
    print(n[0])

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from collections import deque
N, X = map(int, input().split())
L = list(map(int, input().split()))
d = deque([0])
current = 0
for i in range(N):
    current = current + L[i]
    d.append(current)

count = 0
while d.popleft() <= X:
    count += 1

print(count)

Submission status: Runtime Error

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


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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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


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

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
N,x = (int(i) for i in input().split())
L = [int(i) for i in input().split()] 
result = 0
D = 0
for i in range(N + 1):
    if D <= X:
        result += 1
    if i != N:
        D += L[i]
print(result)

Submission status: Runtime Error

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

count = 0
d = 0
while True:
  if d > X:
    break
  l = L_list.pop(0)
  d += l
  count += 1
print(count)

Submission status: Runtime Error

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

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

num = 0
i = 0
d = D[i]
while d <= X and num < N+1:
    num += 1
    i += 1
    d = D[i]

print(num)

Submission status: Runtime Error

Solution code:

def input_from_console():
    n, x = map(int, input().split())
    l_list = list(map(int, input().split()))
    return n, x, l_list


def solve(n, x, l_list):
    result = 0
    position = 0
    for i in range(n+1):
        if position > x:
            return result
        result +=1
        position += l_list[i]
    return result



def main():
    n, x, l_list = input_from_console()
    print(solve(n, x, l_list))


if __name__ == "__main__":
    import sys

    if sys.gettrace():  # Check if the python interpreter is in debug mode or not.
        check_cases()
    else:
        main()

Submission status: Runtime Error

Solution code:
n, x = map(int, input().split())
l = list(map(int, input().split()))
d = [0]
for li in l:
  d.append(d[-1] + li)
print(len([di for di in d if d <= x]))

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

l = [int(s) for s in input().split()]
d = 0
i = 1
d = [0] * (n+1)
count = 0
if n == 1 and x >= l[0]:
    print(1)
elif n == 1 and x < l[0] :
    print(0)
else:

    while True:
        
        
        d[i] = d[i-1] + l[i-1]
        count += 1
        
        if d[i] > x:
            break
        
        i += 1
        if i > n:
            print(count)

    print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
bound_num, line_length = map(int, input().split())
l = list(map(int, input().split()))

bound = 1
length_sum = 0
for i in range(bound_num + 1):
    if(i == bound_num + 1):
        bound += 1
        print(bound)
        exit()
    if(length_sum + l[i] <= line_length):
        bound += 1
    else:
        print(bound)
        exit()
    length_sum += l[i]

Submission status: Runtime Error

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

s = list(map(int,input().split()))
N = s[0]
X = s[1]

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

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

print(counter)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N,x = (int(i) for i in input().split())
L = [int(i) for i in input().split()] 
result = 0
D = 0
for i in range(N + 1):
    if D <= X:
        result += 1
    D += L[i]
print(result)

Submission status: Runtime Error

Solution code:
from itertools import accumulate
n,x = (int(i) for i in input().split())
l = [int(i) for i in input().split()]
ruiseki = list(accumulate(l))
ruiseki.insert(0,0)
i = 0
#print(ruiseki)
while ruiseki[i] <= x and i < n+1:
    i += 1
print(i)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

import sys

input = sys.stdin.readline

cnt = 0

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

    def rec(i, d):
        global cnt
        if d > X:
            return
        cnt += 1
        return rec(i+1, d + L[i])

    rec(0, 0)
    print(cnt)


main()

Submission status: Runtime Error

Solution code:
X,A = (int(x) for x in input().split())
if X == 1:
  L = int(input())
  if L <= A:
    print(2)
  
else:
  L = list(map(int,input().split()))
  cnt = 0
  idx = 0
  ans = 0

  while(ans <= A):
    ans += L[idx]
    idx += 1
    cnt += 1

  print(cnt)

Submission status: Runtime Error

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

L = input().split()
pos = 0
ans = 1
for i in range(N+1):
  pos += int(L[i])
  if(pos <= X):
    ans +=1
  else:
    break
  
print(ans)

Submission status: Runtime Error

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

l = [int(s) for s in input().split()]
d = 0
i = 1
d = [0] * (n+1)
count = 0
if n == 1 and x >= l[0]:
    print(1)
elif n == 1 and x < l[0] :
    print(0)
else:

    while True:
        
        
        d[i] = d[i-1] + l[i-1]
        count += 1
        
        if d[i] > x:
            break
        i += 1

    print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

count = 0
position = 0
for i in range(N):
    if X<position:
        break
    else:
        count += 1
        position += Ls[i]

print(count)

Submission status: Runtime Error

Solution code:
n, x = map(int, input().split())
l = list(map(int, input().split()))
countBound = 0
coordinate = 0
# print(l)

while countBound <= n + 1:
    coordinate += l[countBound]
    countBound += 1
    if coordinate > x:
        break
    else:
        continue

print(countBound)

Submission status: Runtime Error

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

count = 0
d = 0
while True:
  if d > X:
    break
  l = L_list.pop()
  d += l
  count += 1
print(count)

Submission status: Runtime Error

Solution code:
N,X = map(int,input().split())
num = 0
count = 0
listA=list(map(int,input().split()))
    #listA<-[1,2,2,3,1]
    #ここに逐次処理を書けばいいと思う。

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

Submission status: Runtime Error

Solution code:
n,x = (int(i) for i in input().split())  
l = [int(i) for i in input().split()] 
d = 0
i=0
while d <= x or i >= n:
   d+=l[i]
   i+=1

print(i)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

num = 0
i = 0
d = D[i]
while d <= X:
    num += 1
    i += 1
    d = D[i]
print(num)

Submission status: Runtime Error

Solution code:
from itertools import accumulate
n,x = (int(i) for i in input().split())
l = [int(i) for i in input().split()]
ruiseki = list(accumulate(l))
i = 0
while ruiseki[i] <= x and i < n+1:
    i += 1
print(i+1)

Submission status: Runtime Error

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

dis = 0

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n, x = (int(i) for i in input().split())
l = [int(i) for i in input().split()]
count = 1
current = 0
while current <= x:
    current += l[count-1]
    count += 1
print(count-1)

Submission status: Runtime Error

Solution code:
N,X = [int(i) for i in input().split()]
W = []
W = list(map(int,input().split()))
count = 0
Sum = 0
while Sum <= X:
    Sum += W.pop(0)
    count += 1

print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
bound_num, line_length = map(int, input().split())
l = list(map(int, input().split()))

bound = 1
length_sum = 0
for i in range(bound_num + 1):
    if(length_sum + l[i] <= line_length):
        bound += 1
    else:
        print(bound)
        exit()
    length_sum += l[i]

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

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

ans=0

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

print(ans)

Submission status: Runtime Error

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

while step <= X and i <= N+1:
    step += L[i]
    i += 1
    #print(step)

print(i)

Submission status: Runtime Error

Solution code:
from collections import deque

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

l = deque(list(map(int,input().split())))
count = 0
while count <= x:
    count += l.popleft()

print(n-len(l))

Submission status: Runtime Error

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


def solve(n, x, l_list):
    result = 0
    position = 0
    for i in range(n+1):
        if position > x:
            return result
        result +=1
        position += l_list[i]



def main():
    n, x, l_list = input_from_console()
    print(solve(n, x, l_list))


if __name__ == "__main__":
    import sys

    if sys.gettrace():  # Check if the python interpreter is in debug mode or not.
        check_cases()
    else:
        main()

Submission status: Runtime Error

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

count = 0
d = 0
while True:
  l = L_list.pop()
  d += l
  count += 1
  if d > X:
    break
print(count)

Submission status: Runtime Error

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

L = input().split()
pos = 0
for i in range(N+1):
  pos += int(L[i])
  if(pos > X):
    break
  
print(i+1)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

l = [int(s) for s in input().split()]
d = 0
i = 1
d = [0] * (n+1)
count = 0

while True:
    
    
    d[i] = d[i-1] + l[i-1]
    count += 1
    
    if d[i] > x:
        break
    i += 1

print(count)

Submission status: Runtime Error

Solution code:
n, x = map(int, input().split())
numlist = list(map(int, input().split()))
re = 0
ind = 0
count = 0
while re <= x:
  re += numlist[ind]
  count += 1
  ind += 1
print(count)

Submission status: Runtime Error

Solution code:
from collections import Counter
from collections import deque
from functools import reduce
from pprint import pprint
import bisect
import copy
import fractions
import itertools
import math
import queue
import random
import sys
import time
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def MI(): return map(int, sys.stdin.readline().split())
def II(): return int(sys.stdin.readline())
def IS(): return input()
def C(x): return Counter(x)
def GCD_LIST(numbers): return reduce(fractions.gcd, numbers)
def LCM_LIST(numbers): return reduce(LCM, numbers)
def LCM(m, n): return (m * n // fractions.gcd(m, n))


n, x = MI()
l = LI()
z = 0
cnt = 0
if n == 1:
    if l[0] <= x:
        print(2)
    else:
        print(1)
else:
    while z <= x and cnt < n+1:
        z = z + l[cnt]
        cnt += 1
    print(cnt)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N, X = map(int, input().split())
e = [int(i) for i in input().split()]
count = 0
d = 0
for i in range(N+1):
    count += 1
    d += e[i]
    if d > X:
        break

print(count)

Submission status: Runtime Error

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

num = 0
dist = 0
while dist <= x:
  dist += L[num]
  num += 1
  
print(num)

Submission status: Runtime Error

Solution code:
N,X=input().split()
n=int(N)
x=int(X)
i=list(map(int,input().split()))
D=0
k=0
while D<=x:
  D=D+i[k]
  k=k+1
if k<=n+1:
  print(k)
else:
  print(n)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

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

D=0
i=0
c=0
while D <= X:
    D+=l[i]
    i+=1
    c+=1

print(c)

Submission status: Runtime Error

Solution code:
x = input().split()[1]

ls = [int(n) for n in input().split()]

for index in range(len(ls)):
	list = ls[0:index]
	if sum(list) > x:
		print(index)
		break
	elif sum(list) == x:
		print(index + 1)
		break

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from collections import deque

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

l = deque(list(map(int,input().split())))
count = 0
while count < x:
    count += l.popleft()

print(n-len(l)+1)

Submission status: Runtime Error

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

l = [int(x) for x in input().split()]
import sys

sys.setrecursionlimit(20000)

def solve(now,ls,x,cnt):
    if now>x:
        return print(cnt)
    else:
        return solve(now+ls[cnt],ls,x,cnt+1)
solve(0,l,x,0)

Submission status: Runtime Error

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

ans = 0
D = [0] * (N + 2)
for i in range(N+2):
    if i != 1:
        D[i] = D[i-1] + L[i-1]
    if D[i] <= X:
        ans += 1
    else:
        break
print(ans)

Submission status: Runtime Error

Solution code:
a = input().split()
n = int(a[0])
x = int(a[1])
l_str_list = input().split()
d = 0
answer = 0

for i in n:
  d += int(l_str_list[i])
  if d > x:
    answer = i + 1
    break;
print(answer)

Submission status: Runtime Error

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

print(i)

Submission status: Runtime Error

Solution code:

(N,M) = (int(i) for i in input().split(" "))
A = [int(i) for i in input().split()]
for i in range(N):
	A[i+1] += A[i]
	if A[i+1] > M:
		print(i+2)
		break

Submission status: Runtime Error

Solution code:
from itertools import accumulate
n,x = (int(i) for i in input().split())
l = [int(i) for i in input().split()]
ruiseki = list(accumulate(l))
i = 0
while ruiseki[i] <= x:
    i += 1
print(i+1)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

s = list(map(int,input().split()))
N = s[0]
X = s[1]

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

counter = 0
coordinate = 0
i = 0
while(coordinate <= X):
    counter += 1
    coordinate += L[i]
    i += 1

print(counter)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

lis = list(map(int,input().split()))
i = 0
sum = 0
while  sum <= X:
  sum += lis[i]
  i += 1
print(i)

Submission status: Runtime Error

Solution code:
N, X = map(int, input().split())
li = list(map(int, input().split()))
i = 0
D = 0
while D <= X:
    if i > N + 1:
        break
    D += li[i]
    i += 1

if i > N + 1:
    print(N+1)
else:
    print(i)

Submission status: Runtime Error

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

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

d = 0

cnt = 0

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

print(cnt)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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


now = 0
i = 0
ans = 0
while True:
    if now > X:
        break
    now += L[i]
    i += 1
    ans += 1

print(ans)

Submission status: Runtime Error

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