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

Submission status: Wrong Answer

Solution code:
n,x=map(int,input().split())
a=list(map(int,input().split()))
cnt=1
now=0
if sum(a)==x:
    print(n+1)
    exit()
for i in a:
    now+=i
    if now>x:
        print(cnt)
        exit()
    cnt+=1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n, x, *a = map(int, open(0).read().split())
a = [0] + a
for i in range(n): a[i+1] += a[i]
ans = 0
for i in range(n): ans += (a[i]<=x)
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,x=map(int,input().split())
a=list(map(int,input().split()))
cnt=0
now=0
for i in a:
    now+=i
    cnt+=1
    if now>x:
        print(cnt)
        exit()

Submission status: Wrong Answer

Solution code:
k, n = list(map(int, input().split(' ')))
l = list(map(int, input().split(' ')))
ct = 0
ans = 1
i = 0
while ct <= n:
  ct += l[i]
  ans += (ct <= n)
print(ans)

Submission status: Wrong Answer

Solution code:
N, X = [int(s) for s in input().split(' ')]
Ls = [int(s) for s in input().split(' ')]
suma = [0]
for L in Ls:
    suma.append(suma[-1] + L)
    if suma[-1] > X:
        break
print(len(suma) - 1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if d==x:
    a+=1

print(a)

Submission status: Wrong Answer

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

if d==x:
    a+=1

print(a)

Submission status: Wrong Answer

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

if d==x:
    a+=1

print(a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

cumsum = 0

for n in range(N):
    cumsum += L[n]
    if cumsum == X:
        print(n+2)
        exit()
    if cumsum > X:
        print(n+1)
        exit()

Submission status: Wrong Answer

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

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

cumsum = 0

for n in range(N):
    cumsum += L[n]
    if cumsum > X:
        print(n+1)
        exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

cnt = 1
d = 0

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans=0
s=0

for ll in l:
    if s <= x:
        ans+=1
    s+=ll

print(ans)

Submission status: Wrong Answer

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


count = 0
for idx in range(N):
    count += nums[idx]

    if count > X:
        break

print(idx+1)

Submission status: Wrong Answer

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

count = 0
for idx in range(N):
    while count <= X:
        count += nums[idx]

if count == X:
    print(idx + 2)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,k=map(int, input().split(' '))
a=list(map(int, input().split(' ')))
ans,s=0,0
for i in a:
  if s<=k: ans+=1
  else: break
  s+=i
print(ans)

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 li in l:
    if d <= x:
        count += 1
    d += li
print(count)

Submission status: Wrong Answer

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

plot=0
cnt=0

for i in range(n):
    plot += l[i]
    if l[i] <= x:
        cnt += 1

print(cnt)

Submission status: Wrong Answer

Solution code:
#130

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

res = 1
sm = 0
for i in range(1,n):
    if sm + l[i] <= x:
        res += 1
    sm =+ l[i]
print(res)

Submission status: Wrong Answer

Solution code:
from itertools import accumulate
N, X = map(int, input().split())
Llist = list(accumulate(list(map(int, input().split()))))
for i in range(N):
    if Llist[i] > 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
cnt=0
for i in range(N):
    if D<=X:
        cnt+=1
        D +=L[i]
    else:
        break

print(cnt)

Submission status: Wrong Answer

Solution code:
#128 b むずい
n,x=map(int,input().split())
l=list(map(int,input().split()))
z=0
ans=1
for i in range(n):
    z+=l[i]
    if z>x:
        ans=i
        break
print(ans)

Submission status: Wrong Answer

Solution code:
#128 b むずい
n,x=map(int,input().split())
l=list(map(int,input().split()))
z=0
ans=0
for i in range(n):
    z+=l[i]
    if z>x:
        ans=i+1
        break
print(ans)

Submission status: Wrong Answer

Solution code:
#128 b むずい
n,x=map(int,input().split())
l=list(map(int,input().split()))
z=0
ans=0
for i in range(n):
    z+=l[i]
    if z>=x:
        ans=i+2
        break
print(ans)

Submission status: Wrong Answer

Solution code:
def main():
  n, x, *ls = map(int, open(0).read().split())
  d=0
  cou=1
  for l in ls:
    d += l
    if d <= x:
      cou+=1
    else:
      return(cou)
  return n
if __name__ == '__main__':
  print(main())

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

cnt = 0
sum = 0

for i in list:
    sum += i
    cnt += 1
    if sum > X:
        break

print(cnt)

Submission status: Wrong Answer

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

print(count)

Submission status: Wrong Answer

Solution code:
d = 0
d <= 1000
i = 1

Submission status: Wrong Answer

Solution code:
def LI():
  return [int(s) for s in input().split()]

N,X = LI()
L_s = LI()

D = [0]*N

count = 1

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

Submission status: Wrong Answer

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

    sum = 0
    ans = 1

    for i in range(n-1):
        sum += num_list[i]
        if sum <= x:
            ans += 1

    print(ans)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

    sum = 0

    for i in range(n):
        sum += num_list[i]
        if not sum <= x:
            i += 1
            break

    print(i)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

    count = 0
    sum = 0

    while(sum <= x):
        if count >= len(num_list):
            break
        sum += num_list[count]
        count += 1

    print(count)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

total = 0
ans = 0
for i in range( len( l )):
  total += l[ i ]
  if total > x:
    ans = i
    break
print( i + 1 )

Submission status: Wrong Answer

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

total = 0
ans = 0
for i in range( len( l )):
  total += l[ i ]
  if total >= x:
    ans = i
    break
print( i + 1 )

Submission status: Wrong Answer

Solution code:
def calcBoundCount(rangex, lstL):
    d = 0
    for i in range(0, len(lstL)):
        d = d + lstL[i]
        if rangex < d:
            return i + 1
    return len(lstL)

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

count = calcBoundCount(X, lstL)
print((count if count <= N+1 else N+1))

Submission status: Wrong Answer

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

def calcBoundCount(rangex, lstL):
    d = 0
    for i in range(0, len(lstL)):
        d = d + lstL[i]
        if rangex < d:
            return i + 1

print(calcBoundCount(X, lstL))

Submission status: Wrong Answer

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

ans=0
test=0
for i in range(n):
  test+=Len[i]
  if test<=x:
    continue
  else:
    ans=i+1
    break
    
print(ans)

Submission status: Wrong Answer

Solution code:
import sys

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

D = 0

for i in range(0,N):
    D += L[0]
    if D > X :
        print(i)
        sys.exit()

print(N)

Submission status: Wrong Answer

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

#print(l)

a = [0]

for i in range(n):
    a.append(a[i] + l[i])
#    print(a)


for j in range(len(a)):
    if a[j] <= x:
        if j == len(a):
            print(len(a))
        pass
    else:
        print(j)
        break

Submission status: Wrong Answer

Solution code:

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

a = [0]

for i in range(n):
    a.append(a[i] + l[i])

#print(a)

for j in range(len(a)):
    if a[j] <= x:
        pass
    else:
        print(j)
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


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

Submission status: Wrong Answer

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


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

Submission status: Wrong Answer

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

for l in L:
    if D > X:
        break
    D = D + l
    ans += 1

print(ans)

Submission status: Wrong Answer

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

d=[0]
for i in range(1, n+1):
  d.append(d[-1]+l[i-1])
  
print(d)
  
print(len([i for i in d if i <= x]))

Submission status: Wrong Answer

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

d=[0]
for i in range(1,n):
  d.append(d[-1]+l[i-1])
  
print(len([i for i in d if i <= x]))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

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

a = 0
for i in range(n):
    a = a + l[i]
    #print(a)
    if x == a:
        print(i+1+1)
        break
    elif x < a:
        print(i+1)
        break
    else:
        continue
else:
    print(n)

Submission status: Wrong Answer

Solution code:

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

a = 0
for i in range(n):
    a = a + l[i]
    #print(a)
    if x == a:
        print(i+1+1)
        break
    elif x <= a:
        print(i+1)
        break
    else:
        continue
else:
    print(n)

Submission status: Wrong Answer

Solution code:

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

a = 0
for i in range(n):
    a = a + l[i]
    #print(a)
    if x == a:
        print(i+1+1)
        break
    elif x <= a:
        print(i+1)
        break
    else:
        continue
else:
    print(i+1)

Submission status: Wrong Answer

Solution code:

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

a = 0
for i in range(n):
    a = a + l[i]
    #print(a)
    if x == a:
        print(i+1+1)
        break
    elif x <= a:
        print(i+1)
        break
    else:
        continue
    print(i+2)

Submission status: Wrong Answer

Solution code:

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

a = 0
for i in range(n):
    a = a + l[i]
    #print(a)
    if x == a:
        print(i+1+1)
        break
    elif x <= a:
        print(i+1)
        break
    else:
        continue
print(i+2)

Submission status: Wrong Answer

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

a = 0
for i in range(n):
    a = a + l[i]
    #print(a)
    if x == a:
        print(i+1+1)
        break
    elif x <= a:
        print(i+1)
        break
    else:
        continue

Submission status: Wrong Answer

Solution code:
"""
author : halo2halo
date : 9, Jan, 2020
"""

import sys

# import numpy as np
import itertools

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

N, X, *L = map(int, read().split())

Lcum = itertools.accumulate(L)

answer = sum(i < X for i in Lcum)
print(answer + 1)

Submission status: Wrong Answer

Solution code:
import itertools

N, X = [int(_) for _ in input().split()]
L = [int(_) for _ in input().split()]

bounce_positions = list(itertools.accumulate([0]+L))
ans = sum(x < X for x in bounce_positions)
print(ans)

Submission status: Wrong Answer

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

    res = 0
    cnt = 1
    for i in l:
        res += i
        if res <= x:
            cnt += 1
        else:
            print(cnt)
            return

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()

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

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()

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

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()

def main():
    _, x = map(int, input().split())
    l = tuple(map(int, input().split()))

    d_sum = 0
    for i, j in enumerate(l):
        if d_sum > x:
            print(i)
            quit()
        d_sum += j
    else:
        print(i+1)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

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

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

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

Submission status: Wrong Answer

Solution code:
n,x=map(int,input().split())
l=list(map(int,input().split()))
d=[0]
ans=1
for i in range(2,n+1):
    z=d[i-2]+l[i-2]
    d.append(z)
    if z<=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()))

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

print(ans)

Submission status: Wrong Answer

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

tmp = 0
cnt = 0
i = 0
while tmp <= x and i < len(l):
    d = tmp + l[i]
    tmp = d
    cnt += 1
    i += 1

print(cnt)

Submission status: Wrong Answer

Solution code:
N, X = map(int, input().split())
L = list(map(int, input().split()))
check = 0
count = 0
for l in L:
    if check == X:
        print(count+1)
        break
    elif check > X or count == N:
        print(count)
        break
    check = check + l
    count += 1

Submission status: Wrong Answer

Solution code:
N, X = map(int, input().split())
L = list(map(int, input().split()))
check = 0
count = 0
for l in L:
    print(check,count)
    
    if check == X:
        print(count+1)
        break
    elif check > X or count == N:
        print(count)
        break
    check = check + l
    count += 1

Submission status: Wrong Answer

Solution code:
N, X = map(int, input().split())
L = list(map(int, input().split()))
Bounce = [0]
for i in range(len(L)):
    Bounce.append(Bounce[i]+L[i])
    if i == N:
        print(i)
        break
    elif Bounce[-1] > X:
        print(i+1)
        break
    else:
        pass

Submission status: Wrong Answer

Solution code:
N, X = map(int, input().split())
L = list(map(int, input().split()))
pref_sum = [0]*(N+1)
ans = 0

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

for s in pref_sum:
    if s <= X:
        ans += 1     
print(ans)

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 i == N-1:
        res = i+1
        break
    if s > X:
        res = i 
        break

print(res+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, X = map(int, input().split())
L = list(map(int, input().split()))
Bounce = [0]
for i in range(len(L)):
    Bounce.append(Bounce[i]+L[i])
    if Bounce[-1]>X:
        print(i+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+1)]
for i in range(1, N+1):
    D[i]=(D[i - 1] + L[i-1])
    
index = 0
for i, value in enumerate(D):
    if value > X:
        index = i
        break

print(index)

Submission status: Wrong Answer

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

count = 1
dis = 0

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

if count == n+1:
  print(count)

Submission status: Wrong Answer

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

count = 1
dis = 0

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

Submission status: Wrong Answer

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

for i in range(0,n):
  count += 1
  dim += l[i]
  if dim == x:
    print(count+1)
    break
  elif dim > x:
    print(count)
    break
  else:
    continue
  break

Submission status: Wrong Answer

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

for i in range(0,n):
  count += 1
  dim += l[i]
  if dim >= x:
    print(count)
    break
  else:
    continue
  break

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def main():
    N, X = map(int, input().split())
    L = list(map(int, input().split()))
 
    ans = 0
    D = 0
    for i in range(N):
        if D <= X:
          D = D + L[i]
          ans+=1
        
    return ans
    
if __name__ == '__main__':
    print(main())

Submission status: Wrong Answer

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

    ans = 0
    D = 0
    for i in range(N):
        if D > X > (D - L[i]):
            break 
        D = D + L[i]
        ans+=1
           
    return ans
    
if __name__ == '__main__':
    print(main())

Submission status: Wrong Answer

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

    ans = 0
    D = 0
    for i in range(N):
        D = D + L[i]
        ans+=1
        if D > X:
            break    
    return ans
    
if __name__ == '__main__':
    print(main())

Submission status: Wrong Answer

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

    ans = 0
    D = 0
    for i in range(N):
        D = D + L[i]
        if D > X:
            break
        ans+=1
    return ans
    
if __name__ == '__main__':
    print(main())

Submission status: Wrong Answer

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

    ans = 0
    D = 0
    for i in range(N):
        if D > X:
            break
        D = D + L[i]
        ans+=1
    return ans
    
if __name__ == '__main__':
    print(main())

Submission status: Wrong Answer

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

L = [int(i) for i in input().split()]
D, ans = 0, 0

for i in range(len(L)):
    ans, D = ans+1, D+L[i]
    if(X <= D):
        print(ans)
        break

Submission status: Wrong Answer

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

L = [int(i) for i in input().split()]
D, ans = 0, 0

for i in range(len(L)):
    ans, D = ans+1, D+L[i]
    if(X < D):
        print(ans)
        break

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

D=L[0]

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

Submission status: Wrong Answer

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

D=L[0]

if D>X:
    print(0)
else:
    D=0
    i=1
    count=1
    while D<=X and i<N:
        D+=L[i]
        i+=1
        count+=1
    print(count)

Submission status: Wrong Answer

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

D=0
i=0
count=0

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