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

print(n+1)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n,x=str(input()).split(" ")
n=int(n)
l_list=[thing for thing in str(input()).split(" ")]
leng=0
for i in range(n+1):
  if leng >x:
  	return i+1
  leng=leng+l_list[i]

Submission status: Runtime Error

Solution code:
N , X = map(int,input().split())
L = list(input())
cnt = 1
x = 0
lst = list()
for i in range(N):
    if int(len(L) / 2) + 1 > i   :
        lst.append(int(L[i*2]))
    else :
        break
print(lst)
for j in range (N):
    x += lst[j]
    cnt += 1

    if x+lst[j+1] > X :
        break
    if cnt >= N:
        break
print(cnt)

Submission status: Runtime Error

Solution code:
import sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline



def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [W, H, x, y] = [long(input_raw[0]), long(input_raw[1]), long(input_raw[2]), long(input_raw[3])]
    if (H /2 == y) and (W/2 == x) and (H % 2 == 0) and (W % 2 == 0):
        ans2 = 1
    else:
        ans2 = 0

    if(W * y == H * x or y * W ==  (-H * x) + W * H):
        print "%20.15f %d" % (float(W)/2.0 * H , ans2)
        return

    ans = max(min(float(H - y), float(y)) * float(W), min(float(W - x), float(x)) * float(H))
    if (H /2 == y) and (W/2 == x) and (H % 2 == 0) and (W % 2 == 0):
        ans2 = 1
    else:
        ans2 = 0
    print "%20.15f %d" % (ans, ans2)

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
n,x=str(input()).split(" ")
l_list=[thing for thing in str(input()).split(" ")]
leng=0
for i in range(n+1):
  if leng >x:
  	return i+1
  leng=leng+l_list[i]

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
N , X = map(int,input().split())
L = list(input())
cnt = 1
x = 0
lst = list()
for i in range(N):
    if int(len(L) / 2) + 1 > i   :
        lst.append(int(L[i*2]))
    else :
        break
for j in range (N):
    x += lst[j]
    cnt += 1
    if x+lst[j+1] > X :
        break
    if cnt >= N:
        break
print(cnt)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

print(i-1)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N , X = map(int,input().split())
L = list(input())
cnt = 1
b = 0
lst = list()
for i in range(N):
    if int(len(L) / 2) + 1 > i   :
        lst.append(int(L[i*2]))
    else :
        break
for j in range (N):
    b += lst[j]
    cnt += 1

    if b+lst[j+1] > X :
        break
    if cnt >= N:
        break
print(cnt)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

while sum_l <= x:
  sum_l=sum_l+l[a]
  a=a+1
print (a)

Submission status: Runtime Error

Solution code:
N,X=map(int,input().split())
a=[]
for i in range(N):
	a.append(map(int,input().split()))
n=0
d=0
while n<=N:
	if d>X:
		break
	else:
		d=d+a[n]
		n=n+1

print(n+1)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

while (sum_l <= x):
  sum_l=sum_l+l[a]
  a=a+1
print (a)

Submission status: Runtime Error

Solution code:
N , X = map(int,input().split())
L = list(input())
cnt = 1
b = 0
lst = list()
for i in range(N):
    if int(len(L) / 2) + 1 > i   :
        lst.append(int(L[i*2]))
    else :
        break
for j in range (N):
    b += lst[j]
    cnt += 1

    if b+lst[j+1] > X :
        break
    if cnt == N:
        break
print(cnt)

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

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

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

zahyo = 0
i = 0
while(zahyo <= x):
    
    zahyo = zahyo + li[i]
    print(zahyo)
    
    if zahyo <= x:
        i = i+1

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
s=0
while D<=X or i<N:
  D+=L[i]
  s+=1
  i+=1
print(s)

Submission status: Runtime Error

Solution code:
N,　M = input().strip().split()
N,　M = [int(N),int(M)]

array = list(map(int, input().strip().split()))

sum = []

sum.append(array(0))

i = 1

while i < len(array):
	sum[i] = sum[i-1] + a[i]
  
j = 0

count = 0

while sum[j] <= M:
  	count =+ 1
    j =+ 1
    
print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N , X = map(int,input().split())
L = list(input())
cnt = 1
b = 0
lst = list()
for i in range(N + 1):
    if int(len(L) / 2) + 1 > i   :
        lst.append(int(L[i*2]))
    else :
        break
for j in range (N + 1):
    b += lst[j]
    cnt += 1
    if b+lst[j+1] > X :
        break
    if cnt == N:
        break
print(cnt)

Submission status: Runtime Error

Solution code:
N , X = map(int,input().split())
L = list(input())
cnt = 1
b = 0
lst = list()
for i in range(N + 1):
    if int(len(L) / 2) + 1 > i   :
        lst.append(int(L[i*2]))
    else :
        break
for j in range (N + 1):
    print(b)
    b += lst[j]
    cnt += 1
    if b+lst[j+1] > X :
        break
    if cnt == N:
        break
print(cnt)

Submission status: Runtime Error

Solution code:
N,M = input().strip().split()
N,M = [int(N),int(M)]
array = list(map(int, input().strip().split()))

sum = [array[0]]

i = 1

while i < len(array):
	sum[i] = sum[i-1] + a[i]
  
j = 0

count = 0

while sum[j] <= M:
  	count =+ 1
    j =+ 1
    
print(count)

Submission status: Runtime Error

Solution code:
n, x = (int(c) for c in input().split())
l = (int(c) for c in input().split())
l.insert(0,0)
flag = 0
count = 0
for i in range(int(n)+1):
    count = count + int(l[i])

    if count > int(x):
        print(i)
        flag = 1
        break

if flag == 0:
    print(int(n)+1)

Submission status: Runtime Error

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

cnt = 0
m = 0
while m <= X:
    m += L[cnt]
    cnt += 1

print(cnt)

Submission status: Runtime Error

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

while d <= 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()]
d=[0]
for i in range(1,len(L)+1):
    dd=d[i-1]+L[i-1]
    d.append(dd)
for j in range(len(d)):
    if d[j]<=x:
        num+=1
print (num)

Submission status: Runtime Error

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

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

print(i)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

index = 0
Sum = L[0]
while Sum <= X:
    Sum += L[index+1]
    index += 1

print(index+1)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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:
    c+=1
    D+=l[i]
    i+=1
    if i>len(l):
        break

print(c)

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

Submission status: Runtime Error

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

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

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

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

print(sum(res))

Submission status: Runtime Error

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

count = 1

current = 0

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

    print(count)

Submission status: Runtime Error

Solution code:
n,x=map(int,input().split())
li=list(map(int,input().split()))
d=0
c=1
for l in li:
  	d=d+l
	if d>x:
		break
	
	c=c+1
print(c)

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-1):
  re += [numlist[i]]
  if sum(re) > x:
    re = re[:-1]
    break
    
print(len(re))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

i = 0
D = 0

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

print(i)

Submission status: Runtime Error

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

D = 0
bound_count = 0

i = 0
while D <= X:
    D += L[i]
    bound_count += 1
    i += 1

print(bound_count)

Submission status: Runtime Error

Solution code:
#bin/usr/env python3

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

total_len = 0
for i in range(n):
    total_len += int(length[i])
    if total_len > x:
        print(i+1)
        break
    if i = n-1:
        print(n+1)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n,x=map(int,input().split())
li=list(map(input().split()))
d=0
c=1
for l in li:
  	d=d+l
	if d>x:
		break
	
	c=c+1
print(c)

Submission status: Runtime Error

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

index = 1
Sum = L[0]
while Sum <= X:
    Sum += L[index]
    index += 1

print(index)

Submission status: Runtime Error

Solution code:
nx = map(int, raw_input().split())
l = map(int, raw_input().split())

x = nx[1]

d = 0
i = 0

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

print(i)

Submission status: Runtime Error

Solution code:
nx = map(int, raw_input().split())
l = map(int, raw_input().split())

n = nx[0]
x = nx[1]

d = 0
i = 0

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

print(i)

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 = [int(i) for i in input().split()]
W = []
for j in input().split():
    W.append(j)

count = 0
Sum = 0
while Sum <= X:
    Sum += int(W.pop(0))
    count += 1
print(count)

Submission status: Runtime Error

Solution code:
N, X = [int(item) for item in input().split()]
L = [int(item) for item in input().split()][::-1]
D = 0
count = 0
while D <= X:
  l = L.pop()
  D += l
  count += 1
print (count)

Submission status: Runtime Error

Solution code:
import numpy as np

A = input()
B = input()

N,X = map(int,A.split())
L = np.array(list(map(int, B.strip().split())))

L_sum = 0
jump = 1

for i in range(N+1):
  L_sum += L[i]
  if(L_sum>X):
    jump += 0
  else:
    jump += 1

print(jump)

Submission status: Runtime Error

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


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

Submission status: Runtime Error

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

N = INPUT[0]
X = INPUT[1]

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

count = 0

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s = input()
s = list(s)
s2 = input()
s2 = list(s2)
count=1
X = int(s[2])
count = 1
for i in s2:
    if i == ' ':
        continue
    X = X-int(i)
    if X < 0:
        break
    count += 1
print(count)

Submission status: Runtime Error

Solution code:
w,h,x,y = map(int, input().split())

# 横
men1 = w * y
men2 = w * (h-y)

# 縦
men3 = x * h
men4 = (w-x) * h


#print("{0} {1} {2} {3}".format(str(men1), str(men2), str(men3), str(men4)))
out1 = max(min(men1, men2), min(men3, men4))
if min(men1, men2) == min(men3, men4):
    out2 = 1
elif x != 0 and y != 0 and (h / w) == (y / x):
    out1 = w * h / 2
    out2 = 1
else:
    out2 = 0

print("{0} {1}".format(out1, out2))

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:
    c+=1
    D+=l[i]
    i+=1


print(c)

Submission status: Runtime Error

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

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:
  if k<=n+1:
    D=D+i[k]
    k=k+1
  else:
    k=n+1
print(k)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

i = 0
D = 0

while D <= X:
    D = D + L[i]
    i = i + 1

print(i)

Submission status: Runtime Error

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

count = 0
x = 0

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

Submission status: Runtime Error

Solution code:
,x=map(int,input().split())
ans=0
oh=0
l=[int(i) for i in input().split()]
for j in l:
  if sum(l)<=x:
      if x>=oh:
          ans+=1
  elif x>=oh:
      ans+=1
  oh+=j   
if sum(l)<=x:
  print(ans+1)
else:
  print(ans)

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:
  if k<=n+1:
    D=D+i[k]
    k=k+1
print(k)

Submission status: Runtime Error

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

counter = 0
coordinate = 0

while counter < n+1 and coordinate<=x:
    counter+=1
    if counter = n+1:
        break
    else:
        coordinate += l_array[counter-1]


print(counter)

Submission status: Runtime Error

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

print(i + 1)

Submission status: Runtime Error

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

l_d = []
d = 0
i = 0
while d <= x:
    l_d.append(d)
    d = d + l[i]
    i += 1
print(len(l_d))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import numpy as np

A = input()
B = input()

N,X = map(int,A.split())
L = np.array(map(int,B.split( )))
L_sum = 0
jump = 1
for i in range(N+1):
  L_sum += L[i]
  if(L_sum<X):
    jump += 1 
  else:
    jump += 0

print(jump)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

l_list = l.split(' ')

for i in l_list:
    cnt += i
    if cnt > x:
        break
    ans += 1

print (ans)

Submission status: Runtime Error

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

counter = 0
coordinate = 0

while counter < n+1 and coordinate<=x:
    counter+=1
    coordinate += l_array[counter-1]

print(counter)

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

Submission status: Runtime Error

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

counter = 0
coordinate = 0

while counter < n+1 and coordinate<=x:
    coordinate += l_array[counter]
    counter+=1

print(counter)

Submission status: Runtime Error

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

L = list(map(int, input().split()))
D = [0] * 10000

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

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
n,x=map(int,input().split())
L=input().split()
L=[int(i) for i in L]
count=0
l=0
while l<=x:
    l=l+L[count]
    count=count+1
print(count)

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)

for i in range(len(D)):
    if D[i] > X:
        ans = i
        break
    elif D[i] == X:
        ans = i
        break
    else:
        pass
print(ans)

Submission status: Runtime Error

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

pos = 0

for i in range(N+1):
    pos = pos + l[i]

    if pos > X:
        print(i+1)
        exit()

print(i+1)

Submission status: Runtime Error

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

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

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

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):
    if(X >= S + L[i]):
        step = step + 1
        S = S + L[i]
    else:
        break
print(step)

Submission status: Runtime Error

Solution code:
def count_times(x, value, bounds, i):
    value += bounds[i]

    if x < value:
        print(i + 1)
    else:
        count_times(x, value, bounds, i + 1)

data = []
data.extend(list(map(int, input().split(" "))))
data2 = []
data2.extend(list(map(int, input().split(" "))))        
x = data[1]
bounds = data2
count_times(x, 0, bounds, 0)

Submission status: Runtime Error

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

pos = 0

for i in range(N+1):
    pos = pos + l[i]

    if pos > X:
        print(i+1)
        exit()

print(N+1)

Submission status: Runtime Error

Solution code:
s = input()
s = list(s)
s2 = input()
s2 = list(s2)
D=0
count=1
for i in s2:
    if i==' ':continue
    D=D+int(i)
    if D<=int(s[2]):
        count+=1
print(count)

Submission status: Runtime Error

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

d=0
if(x==0):
print(0)
else:
    for i in range(n):
        d=d+w[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=input().split()

D=[]
D.append(0)
for i in range(0,N+1):
    D.append(D[i]+int(L[i]))
    m=i+1
    if(D[i+1]>X):
        break

print(m)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

count = 0
d = 0
for i in range(N):
  l = L_list[i]
  d += l
  count += 1
  if d > X:
    exit()
print(count)N, X = map(int, input().split())
L_list = list(map(int, input().split())) 

count = 0
d = 0
for i in range(N):
  if d > X:
    print(count)
    exit()
  l = L_list[i]
  d += l
  count += 1

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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


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

print(m)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

    while True:
        i = 0
        max += l[i]
        if max < x:
            ans += 1
        i += 1
    print(ans)

Submission status: Runtime Error

Solution code:
a=list(map(int,input().split()))
L=list(map(int,input().split()))
N=a[0]
X=a[1]
l=[0]
n=0
n1=0
while True:
    l.append(L[n]+l[n])
    n=n+1
    if n==N:
        break
while True:
    if l[n1]<=X:
        n1+=1
    else:
        print(n1)
        break

Submission status: Runtime Error

Solution code:
import numpy as np

A = input()
B = input()

N,X = map(int,A.split())
L = np.array(list(map(int,B.split( ))))
L_sum = 0
jump = 1
for i in range(N+1):
  L_sum += L[i]
  if(L_sum<X):
    jump += 1 
  else:
    jump += 0

print(jump)

Submission status: Runtime Error

Solution code:
import sys

input = sys.stdin.readline


def main():
    n, x = [int(i) for i in input().split()]
    l_list = [int(i) for i in input().split()]
    d_list = [0]
    d = d_list[0]
    for i in range(1, n):
        d = d + l_list[i - 1] * (i <= n + 1)
        d_list.append(d)
    print(len(filter(lambda i: i <= x, d_list)))


if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
lst = input().split()
n = int(lst[0])
lim = int(lst[1])
zap = input().split()
pos =[]
pos.append(0)
pos.append(int(zap[0])
for i in range(2,n,1):
    pos.append(int(zap[i]) + int(zap[i-1]))
for i in range (n+1):
    if (pos[i] <= lim):
        cont += 1
print(cont)

Submission status: Runtime Error

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

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:
   print(k)
else:
   print(n+1)

Submission status: Runtime Error

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

i = 0
while True:
    if x - l[i] < 0:
        break
    x -= l[i]
    i += 1

print(i+1)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

print(i + 1)

Submission status: Runtime Error

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

index = 0
flg = True
while flg:
    if d[index] <= X:
        index += 1
    else:
        flg = False

print(index)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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):
    if x==0:
        break
    d=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()))

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

print(i + 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 or X == S):
        S = S + L[i]
        step = step + 1
    else:
        break
print(step)

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())
bound_limit= N+1
L = list(map(int,input().split()))
sum=0
count=1
for i in range(0,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().rstrip().split())
l = map(int, input().rstrip().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:
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;
    else:
        break;
print(count)

Submission status: Runtime Error

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