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()))
countBound = 0
coordinate = 0
# print(l, len(l))

while True:
    if coordinate > x or countBound >= n:
        break
    else:
        # print(countBound)
        coordinate += l[countBound]
        countBound += 1

countBound += 1
print(countBound)

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:
i = list(map(int, input().split()))
j = list(map(int, input().split()))
d = 0
x = i[1]
y = i[0]
for i in range(i[0]):
  d = d + j[i] 
  if d > x:
    print(i+1)
    break

if d <= x:
  print(y)

Submission status: Wrong Answer

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 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
c = 1
for i in l:
	d = d + i
	if d>x:
		print(c)
		break
	else:
		c+=1
print(c)

Submission status: Wrong Answer

Solution code:
n,x=map(int,input().split())
l=list(map(int,input().split()))
k=0
ans=1
while k<=x:
 k+=l[ans-1]
 if k<=x:
  ans+=1
 if ans==n:
  ans=n+1
  break
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

bounce = [0] + [ sum(ls[:i]) for i in range(1, len(ls)+1) ]

print(bounce)
for i, v in enumerate(bounce):
  if v > x:
    print(i)
    break
else:
  print(len(bounce))

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

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)

Submission status: Wrong Answer

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

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]
    return result + 1



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:
def main():
    n, x = map(int, input().split())
    l = list(map(int, input().split()))

    l_sum = 0
    ans = 0
    for i in l:
        if l_sum <= x:
            ans += 1
            l_sum += i
        else:
            break
    
    print(ans)


if __name__ == '__main__':
    main()

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 = list(map(int,input().split()))
a = 0
b = 0
for val in L:
  if b<=X:
    a += 1
    b += val
  else:
    break
print(a-1)

Submission status: Wrong Answer

Solution code:
N, X = map(int, input().split())
L = map(int, input().split())
x = 0
n = 0
for l in L:
  if x > X:
    break
  else:
    x += l
    n += 1
    
if x == X:
  print(n+1)
else:
  print(n)

Submission status: Wrong Answer

Solution code:
n,x=map(int,input().split())
l=list(map(int,input().split()))
k=0
ans=1
while k<=x:
 k+=l[ans-1]
 if k<=x:
  ans+=1
 if ans==n:
  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
i = 0
if x > 0:
    while d <= x:
        d = d + l[i]
        i = i + 1
        if i >= n:
            break 
    print(i)
elif x <= 0:
    print(1)

Submission status: Wrong Answer

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

d = 0
count = 1
if x == 1:
    print(count)
else:
    for l in range(len(L)):
        if d <= x:
            d += L[l]
            if d > x:
                print(count)
                break
            count += 1

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
N,X = map(int,input().split())

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


res = 0
i = 0
ans = 0
while res <= X:
    res += li[i]
    i += 1

    if i == N:
        if res == X:
            i += 1
            break
        else:
            break   

print(min(i,N+1))

Submission status: Wrong Answer

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

#print(L)
#print(D)

for i in range(N):
  #print(i+2,end=" ")
  #print(L[i],end=" ")
  D=D+L[i]
  #print(D)
  if D>X:
    print(i+1)
    break
print(N+1)

Submission status: Wrong Answer

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

D = 0
for i in range(n):
    print(D)
    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()))

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

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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(1, N+1):
    if i != 1:
        D[i] = D[i-1] + L[i-1]
    if D[i] <= X:
        ans += 1
    else:
        break
print(ans)

Submission status: Wrong Answer

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

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])
    c+=t
    ans+=1
    if(c>=n):
        break
print(ans)

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]
    return result + 1



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=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+1)

Submission status: Wrong Answer

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

bounce = [0] + [ sum(ls[:i]) for i in range(1, len(ls)+1) ]

for i, v in enumerate(bounce):
  if v > x:
    print(i)
    break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, X = [int(i) for i in input().split()]
Ls = [int(l) for l in input().split()]
d = 0
res = 1
for i, Li in enumerate(Ls):
    if d <= X and i < N:
        res += 1
        d += Li
    else:
        break
print(res)

Submission status: Wrong Answer

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

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

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

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:
    break

print(i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

count = 0
sum_val = 0
for val in L:
    count += 1
    sum_val += val
    if sum_val > X:
        break

print(count)

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]
    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:
# -*- coding: utf-8 -*-
import sys;
import string;
sys.setrecursionlimit(20000) # 再起呼び出しの最大数をセット

import copy
import itertools

from functools import lru_cache
#@lru_cache(maxsize = None)

PPP = 1000000007

# 整数の入力
#n = int(input())

# スペース区切りの整数の入力
#a = [int(x) for x in input().split()]
n, x = map(int, input().split())
#print("sp", n, k, file=sys.stderr)
#p, q, r = map(int, input().split())
l = [int(x) for x in input().split()]

# 改行区切りの整数の入力
#a = []
#for x in range(n):
#  a.append(int(input()))
#  a.append([int(x) for x in input().split()])
#p = [int(x) for x in input().split()]
#a.sort()
print(l, file=sys.stderr)

# 文字列の入力
#s = input()

# 出力
#print("{} {}".format(a+b+c, s))
#a.sort()
#print(set(a), file=sys.stderr)
#print(len(set(a)))

#cache = dict()

import re

def doit():
  p = 0
  res = 0
  for lx in l:
    if x < p:
      break
    p += lx
    res += 1
  
  return res

#print(doit([0] * 4))
#doit(s)
try:
  print(doit())
except Exception as e:
  print("e", e, file=sys.stderr)

Submission status: Wrong Answer

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

ls2 = []
ls2.append(0)
for i in range(n):
  ls2.append(ls1[i]+ls2[i])

ct=0
for j in range(n):
  if ls2[j]<=x:
    ct += 1
print(ct)

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

Submission status: Wrong Answer

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

cnt = 0
total = 0
i = 0

while total <= X:
    cnt += 1
    total += L[i]
    i += 1
    if i >= N:
        cnt = N + 1
        break

print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

L2=[0]
for i in L:
  L2.append(L2[-1]+i)
  if X < L2[-1]:
    print(len(L2)-1)
    exit()

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+1)

Submission status: Wrong Answer

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

s = 0
i = 0
while (s<=X)&(i<N):
    s+=List[i]
    i+=1

if i==N:
    if sum(List)<X:
        print(i+1)
    else:
        print(i)
        
else:
    print(i)

Submission status: Wrong Answer

Solution code:
import sys

N = map(int, raw_input().strip().split())
L = map(int, raw_input().strip().split())
pos = 0
for i in range(N[0]):
    if(L[0] > N[1]):
        print(0)
        sys.exit()
    if (pos + L[i]) > N[1]:
        print(i+1)
        sys.exit()
    else:
        pos +=L[i]

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

sum = 0
count = 0
for i in range(n):
    count = count + 1
    sum = sum + L[i]
    if sum > x:
        break

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

while countBound <= n + 1:
    # print(countBound)
    coordinate += l[countBound]
    countBound += 1
    if coordinate > x or countBound >= n:
        break
    else:
        continue

print(countBound)

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]
        
print(count)

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:
        break
    cnt += 1
print(cnt)

Submission status: Wrong Answer

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

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

    ans = 0
    d = 0

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


if __name__ == "__main__":
    solve()

Submission status: Wrong Answer

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

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

count = 0
ans = 0
for i in boundlist:
    if count <= X:
        count += i
        ans += 1
if N == 1 and X >= boundlist[0]:
    print(ans + 1)
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
N, X = map(int, input().split())
L = list(map(int, input().split()))
Y = list()
for i in range(N):
  A = sum(L[0:i])
  if A <= X:
    Y.append(A)
  else:
    break
print(len(Y))

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])
    c+=t
    ans+=1
    if(c>n):
        break
print(ans)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = list(map(int, input().split()))
b = list(map(int, input().split()))
N = a[0]
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:

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
line = input().split()
N = int(line[0])
X = int(line[1])
line = [int(p) for p in input().split()]
pos = 0
count = 0
for i in range(len(line)):
  if pos >= X:
    break
  pos += line[i]
  count+=1
print(count)

Submission status: Wrong Answer

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

#print(L)
#print(D)

for i in range(N):
  #print(i+2,end=" ")
  #print(L[i],end=" ")
  D=D+L[i]
  #print(D)
  if D>X:
    print(i+1)
    break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 0
jmp = 0
for i in l:
    if jmp == 0:
        jmp = i
    else:
        jmp += i
    
    if jmp > x:
        print(ans)
        break
        
    ans += 1

Submission status: Wrong Answer

Solution code:
N, X = [int(i) for i in input().split()]
Ls = [int(l) for l in input().split()]
d = 0
res = 0
for i, Li in enumerate(Ls):
    if d <= X and i < N:
        res += 1
        d += Li
    else:
        break
print(res)

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

Submission status: Wrong Answer

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

Solution code:
print(0)

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):
        s = ii
        break
    ii+=1
print(s)

Submission status: Wrong Answer

Solution code:
import sys
import numpy as np

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

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

x = np.zeros(N+1)

for n in range(1,N+1):
    x[n] = x[n-1] + L[n-1]
    if x[n] >= X:
        print(n)
        sys.exit()

print(N)

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

Submission status: Wrong Answer

Solution code:
from collections import deque

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

l = deque(list(map(int,input().split())))
count = 0

if sum(l) < x:
    print(n+1)
else:
    while count <= x:
        count += l.popleft()
        if len(l) == 0:
            break

    print(n-len(l))

Submission status: Wrong Answer

Solution code:
N, X = [int(i) for i in input().split()]
Ls = [int(l) for l in input().split()]
d = 0
res = 0
for i, Li in enumerate(Ls):
    print("i=", i+1, "Li=", Li, "d=", d)
    if d <= X and i < N:
        res += 1
        d += Li
    else:
        break
print(res)

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

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:
    print(i)
    break

Submission status: Wrong Answer

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

t=0
ans=0


for i in range(n):
  if t <= x:
    t += l[i]
    ans +=1
    
print(ans)

Submission status: Wrong Answer

Solution code:
n,x=list(map(int, input().split(" ")))
L=list(map(int, input().split(" ")))
m,sum=0,0
for l in L:
    sum+=l
    m+=1
    if sum>=x:
        break
print(min(m,n+1))

Submission status: Wrong Answer

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

pos, jumps, count = 0, 0, 0
while pos <= x and jumps < n:
    pos += nums[jumps]
    jumps += 1
    print(pos)

print(jumps)

Submission status: Wrong Answer

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

def main():
    N, X = map(int, input().split())
    L = list(map(int, input().split()))
    L.insert(0, -1)

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


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

wa = 0
count = 0
for i in range(n):
  wa += ls[i]
  if wa > x:
    break
  count += 1
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


x = 0
if L[0] >= X:
    print(1)
    exit()
for i, n in enumerate(L):
    x += n
    if x > X:
        print(i+1)
        exit()

Submission status: Wrong Answer

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

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!

n,x=map(int,input().split())
l=list(map(int,input().split()))
height=0
lis=[0]
for i in range(n):
    height+=l[i]
    lis.append(height)
    if int(lis[-1])==x:
        print(len(lis))
        break
    elif lis[-1]>x:
        print(len(lis)-1)
        break

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


def solve(N: int, X: int, L: "List[int]"):
    x = 0

    pos = [0]
    for i,l in enumerate(L):
        x += l
        pos.append(x)

    for i,p in enumerate(pos):
        if p > X:
            print(i)
            return





# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    X = int(next(tokens))  # type: int
    L = [ int(next(tokens)) for _ in range(N) ]  # type: "List[int]"
    solve(N, X, L)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
n,x=map(int,input().split(" "))
l=input().split(" ")
c=0
ans=0

for i in range(n):
    t=int(l[i])
    c+=t
    ans+=1
    if(c>n):
        break
print(ans)

Submission status: Wrong Answer

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

if n == 1:
    if x < L[1]:
        print(1)
    else:
        print(2)

else:
    tmp = 0
    count = 0
    for i in range(n+1):
        tmp += L[i]
        if x < tmp:
            print(count)
            break
        count += 1

Submission status: Wrong Answer

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

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)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = input().split()
Y = input().split()

D = 0
Da = 0

for i in range(int(X[0])):
    D = Da + int(Y[i])
    if D > int(X[1]):
        break
    Da = D

if (i == len(Y)-1):
    print(len(Y) + 1)
else:
    print(i+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

cnt = 0
di = 0

if sum(l) < x or sum(l) is x:
  print(n + 1)
else:
  for i, li in enumerate(l):
    di += l[i]
    if di > x:
      break
    
  print(i+1)

Submission status: Wrong Answer

Solution code:

def main():
    n, x = map(int, input().split())

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

    result = 1
    D = 0
    count = 1

    for i in L:
        if count > n + 1:
            break


        newD = D + i
        if newD <= x:
            result = result + 1
            D = newD
        
        count = count + 1
        


    return result

if __name__ == "__main__":
    print(main())

Submission status: Wrong Answer

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

L = [0] * (N + 1)
for c in range(1, N + 1):
    L[c] = L[c - 1] + l[c - 1]

count = 0

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

Submission status: Wrong Answer

Solution code:
str = input()
N = int(str.split()[0])
X = int(str.split()[1])

str = input()
L = []
for i in range(N) :
	L.append(int(str.split()[i]))

D = 0
i = 0
while(D <= X) :
	if (i == len(L)) :
		if (not(D <= X)):
			i = N + 1
		break
	D = D + L[i]
	i = i + 1


print(i)