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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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(len(l) == i):
        break;

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

Submission status: Wrong Answer

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

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

print(m)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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 and coordinate<=x:
    coordinate += l_array[counter]
    counter+=1

print(counter)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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 i == N :
    break
if cnt == 0:
  print(cnt+1)
else:
  print(cnt)

Submission status: Wrong Answer

Solution code:
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: Wrong Answer

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

Submission status: Wrong Answer

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

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


for i in range(n):
   if x >= sum(w[:i+1]):
      next
   else:
      print(i+1)
      break

Submission status: Wrong Answer

Solution code:

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

cnt = 1
d = 0
for n in range(N):
    if n == 0:
        continue
    d += L[n-1]
    if d <= X:
        cnt += 1
    else:
        break
print('{}'.format(cnt))

Submission status: Wrong Answer

Solution code:
a=list(map(int,input().split()))
L=list(map(int,input().split()))
N=a[0]
X=a[1]
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
    if n1==N:
        print(n1)
        break

Submission status: Wrong Answer

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

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

if now <= X:
    a += 1

Submission status: Wrong Answer

Solution code:

line1 = input().split()
n = int(line1[0])
x = int(line1[1])
L = list(map(int,input().split()))

d = 0
for i,l in enumerate(L):
	if d > x or i == n:
		d += l
		print(i)
		break
	d += l

Submission status: Wrong Answer

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

bound = [0]
for i in range(1, n):
    if i == 1:
        bound.append(lst[i-1])
    else:
        b = bound[i-1] + lst[i-1]
        bound.append(b)

ans = []
for i in bound:
    if i <= x:
        ans.append(i)
    else:
        pass
print(len(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

while d<=x:
   if len(l)<=k:
    break
   else:
    d=d+l[k]
    k=k+1
  
if n+1<k:
  print(n+1)
else:print(k)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

#print(n)
#print(x)

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

#print(l)

dis = 0
cnt = 0

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

print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = 0
d = 0
for i in b:
    for j in b:
        if a[1] == 0:
            d = 1
            break
        elif c > a[1]:
            break
        else:
            c += j
            d += 1
print(d)

Submission status: Wrong Answer

Solution code:
from sys import stdin, stdout

if __name__ == "__main__":
	N, X = stdin.readline().split(" ")
	N = int(N)
	X = int(X)

	L = []
	for e in stdin.readline().split(" "):
		L.append(int(e))

	start = 0
	i = 1
	while i <= N and start <= X:
		start = start + 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()))
c = 0
d = []
d.append(0)

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

Submission status: Wrong Answer

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

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

print(count)

Submission status: Wrong Answer

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 = [[3, 6], [3, 4, 5]]
print(data)

x = data[0][1]
bounds = data[1]
count_times(x, 0, bounds, 0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from collections import Counter as D, defaultdict as dd
from math import factorial as ft, ceil as aron
from fractions import gcd as pg 
from bisect import insort as ins, bisect_left as bl, bisect_right as br
import sys

#sys.stdin=open("./testfile.txt","r")
raw_input=sys.stdin.readline

f1=lambda : map(int,raw_input().split())
f2=lambda : map(int,list(raw_input()))
f3=lambda : int(raw_input())
f4=lambda : raw_input().rstrip()

f1=lambda : map(int,raw_input().split())
n,p= f1()
l= f1()
d=[0]
ans=-1
i=1
j=1
while ans==-1 and i<n:
	d.append(d[-1]+l[i-1])
	if d[-1]>p:
		ans=j
	elif d[-1]==p:
		ans=j+1
	i+=1
	j+=1
if i==n:
	print n+1
else:
	print ans

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

length = 0
for i, l in enumerate(L):
    length += l
    if length==X:
        print(i+2)
        break
    elif length>X:
        print(i+1)
        break
    if i == N+1:
        print(i)
        break
    if i == len(L):
        print(i+1)
        break

Submission status: Wrong Answer

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

d = 0
ans = 0

for i in range(1,n+1):
    if d <= x:
        ans += 1
        d += li[i-1]
    else:
        d += li[i-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):
    D = D + L[i]
    if D > X:
        print(str(i + 1))
        break

Submission status: Wrong Answer

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

count = 0
d = 0

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

print(count)

Submission status: Wrong Answer

Solution code:
def main():
    N, X = map(int, input().split())
    lst = list(map(int, input().split()))
    lst = sorted(lst)
    cnt = 0
    s = 0
    for i in range(N):
        if s <= X:
            cnt += 1
        s += lst[i]
    print(cnt)
main()

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:
N, X = map(int, input().split())
L = list(map(int, input().split()))
i = 0
cnt = 0
while X >= 0:
  X -= L[i]
  i += 1
  cnt += 1
  if i == N :
    break
if cnt == 0:
  print(cnt+1)
else:
  print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

line1 = input().split()
n = int(line1[0])
x = int(line1[1])
L = list(map(int,input().split()))

d = 0
for i,l in enumerate(L):
	if d > x or i == n:
		d += l
		print(i+1)
		break
	d += l

Submission status: Wrong Answer

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)

Submission status: Wrong Answer

Solution code:
N, X = input().split(' ')
line = input().split(' ')


cnt = 0
cnt_i = int(X)
for i in line:
    if cnt_i >= 0:
        cnt_i -= int(i)
        cnt+=1

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

#print(n)
#print(x)

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

#print(l)

dis = 0

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

Submission status: Wrong Answer

Solution code:
n, x = input().split()
L = input().split()
for i, l in enumerate(L):
  if i == 0:
    D = 0
  else:
    D = int(l) + D
    
  if D > int(x):
    print(i)
    break
    
  elif i+1 >= int(n):
    print(n)

Submission status: Wrong Answer

Solution code:
n,x=map(int,input().split())
ln= list(map(int, input().split()))
result=[]
for i in range(0,10000):
    a=ln[:i]
    b=sum(a)
    d=a
    result.append(d)
    if b>x:
        break
e=len(result)
f=e-1
print(f)

Submission status: Wrong Answer

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

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

print(i + 1)

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
from collections import Counter as D, defaultdict as dd
from math import factorial as ft, ceil as aron
from fractions import gcd as pg 
from bisect import insort as ins, bisect_left as bl, bisect_right as br
import sys

#sys.stdin=open("./testfile.txt","r")
raw_input=sys.stdin.readline

f1=lambda : map(int,raw_input().split())
f2=lambda : map(int,list(raw_input()))
f3=lambda : int(raw_input())
f4=lambda : raw_input().rstrip()

f1=lambda : map(int,raw_input().split())
n,p= f1()
l= f1()
d=[0]
ans=-1
i=0
j=1
while ans==-1 and i<n:
	d.append(d[-1]+l[i-1])
	if d[-1]>p:
		ans=j
	elif d[-1]==p:
		ans=j+1
	i+=1
	j+=1
if i==n:
	print n+1
else:
	print ans

Submission status: Wrong Answer

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

count = 0
d = 0

for l in L:
#    print(d,end=' ')
    if (d <= X):
        count += 1
#print()
print(count)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# 入力の受付
n, x = map(int, input().split())
l_list = input().split()

# 回数の記録
count = 0
d_list = list()
for i in range(n):
    if i == 0:
        count += 1
        d_list.append(0)
    else:
        d_list.append(d_list[i-1] + int(l_list[i-1]))
        if d_list[i] <= x:
            count += 1

# 結果の出力
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 0
bound = 1

if n == 1:
    print(bound + 1)
    exit(0)

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if n == 0:
    print(0)
else:
    li = list(map(int,input().split()))
    if x == 0:
        print(1)

    else:

        sum1 = 0
        v=0
        for i, l in enumerate(li):
            sum1 += l
            v = i
            if sum1 > x:
                break
        else:
            v += 1

        su = sum(li)
        if x <= su:
            v += 1

        print(v)

Submission status: Wrong Answer

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

ans = 0
bound = 1

if n == 1:
    print(bound)
    exit(0)

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

Submission status: Wrong Answer

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

now = 0
for count, l in enumerate(L):
    now += l
    if now > X:
        break

print(count+1)

Submission status: Wrong Answer

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


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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import itertools 
n,x = list(map(int,input().split()))
l = list(map(int,input().split()))
k = list(itertools.accumulate(l))
k.append(0)
k.sort()
s = 0
ii = 0

for i in k:
    if(i<=x):
        continue
    else:
        ii+=1
        break
if(s==0):
    print(n)
else:
    print(max(1,s))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())

C = map(int, input().split())
x = 0
cnt = 0
for i in C:
    if x <= B:
        cnt += 1
        x += i
    else:
        break

print(cnt)

Submission status: Wrong Answer

Solution code:

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

ans=0
cur_X = 0
pos_N = 0

for i in range(N):
    ans += 1
    cur_X += L[i]

    if cur_X > X:
        break

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if n == 0:
    print(0)
else:

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

    if x == 0:
        print(0)


    else:

        sum1 = 0
        v=0
        for i, l in enumerate(li):
            sum1 += l
            v = i
            if sum1 > x:
                break
        else:
            v += 1

        su = sum(li)
        if x <= su:
            v += 1

        print(v)

Submission status: Wrong Answer

Solution code:
N ,X = map(int, input().split())
difs = list(map(int, input().split()))
steps = [0]
for i in range(N):
    steps.append(steps[i] + difs[i])
for i in range(N+1):
    if steps[i] > X:
        print(i)
    elif i == N:
        print(N+1)

Submission status: Wrong Answer

Solution code:
N,X = map(int,input().split())
L = list(map(int,input().split()))
a = 0
b = 0
for val in L:
  if b<=X:
    a += 1
    b += val
  else:
    break
print(a)

Submission status: Wrong Answer

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

length = 0
for i, l in enumerate(L):
    length += l
    if length==X:
        print(i+2)
        break
    elif length>X:
        print(i+1)
        break
    if i == N+1:
        print(i)
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())

C = map(int, input().split())
x = 0
cnt = 1
for i in C:
    if x == 0:
        x += 1
    elif x <= B:
        cnt += 1
        x += i
    else:
        break

print(cnt)

Submission status: Wrong Answer

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 range(n):
  d += int(l_str_list[i])
  if d > x:
    answer = i + 1
    break
  if d == x:
    answer = i + 2
    break
print(answer)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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


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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from itertools import accumulate
N,X = map(int, input().split())
Ls = [0]+list(map(int, input().split()))
D = list(accumulate(Ls))

for i,d in enumerate(D):
    if d>X:
        break
print(i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 0
sum = 0
L.insert(0, 0)

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


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

print(m)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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]):
        break;

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

Submission status: Wrong Answer

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

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

position = 0
count = 0

for l in list_l:
    position += l
    if position <= X:
        count += 1

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

cnt = 0
total = 0

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

Submission status: Wrong Answer

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


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

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

Submission status: Wrong Answer

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
        if i >= n:
            i + 1
            break
    print(i)
elif x <= 0:
    print(1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

pos = 0

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

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

print("1")

Submission status: Wrong Answer

Solution code:
N, X = map(int, input().split())
L = list(map(int, input().split()))
l = L[0]
count = 1

for i in range(1, N):
    if X >= l:
        count += 1
        l += L[i]

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

print(i)

Submission status: Wrong Answer

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):
        if position > x:
            return result
        result +=1
        position += l_list[i]
    if position > x:
        return result + 1
    else:
        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: Wrong Answer

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

D=0
for i,Li in enumerate(L):
  D=D+Li
  if D>X:
    break
print(i+1)

Submission status: Wrong Answer

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

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

# print(f"D:{D}")

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

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

print(i+1)

Submission status: Wrong Answer

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

pos = 0

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

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

print(i+1)

Submission status: Wrong Answer

Solution code:
import sys

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

N = list[0]
X = list[1]

i = 1
total = 0

for len in length_list:
  total = total + len
  if total <= X:
    i = i + 1
  else:
    print(i)
    sys.exit()

Submission status: Wrong Answer

Solution code:
import itertools 
n,x = list(map(int,input().split()))
l = list(map(int,input().split()))
k = list(itertools.accumulate(l))
if 0 not in k:
    k.append(0)
k.sort()
s = 0
ii = 0

for i in k:
    if(i>x):
        s = ii
        break
    ii+=1
if(s==0):
    print(n)
else:
    print(s)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
x,n=map(int,input().split())
l=input().split(" ")
c=0
ans=0
for i in range(x):
    t=int(l[i])
    if(c>n):
        break
    c+=t
    ans+=1

print(ans)

Submission status: Wrong Answer

Solution code:
N,X=map(int,input().split())
L=[i for i in map(int,input().split())]
count=1
total=1
for num in L:
    total+=num
    if total>=X:
        print(count)
        break
    count+=1