TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: 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?

Submission attempts (in order):
n,x=map(int,input().split())
l=list(map(int,input().split()))
ans=1
pop=0
for i in range(n):
    if(pop>x):
        break
    pop+=l[i]
    ans+=1
print(ans)

n,x=map(int,input().split())
l=list(map(int,input().split()))
ans=0
pop=0
i=0
while(pop<=x or i<n):
    pop+=l[i]
    ans+=1
    i+=1
print(ans)

n,x=map(int,input().split())
l=list(map(int,input().split()))
ans=1
place=0
for i in l:
    place+=i
    if place>x:
        break
    ans+=1
print(ans)

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
n,x= [int(i) for i in input().split()]
L=[int(i) for i in input().split()]
d=[0]
for i in range(1,len(L)+1):
    dd=d[i-1]+L[i-1]
    d.append(dd)
for j in range(len(d)):
    if d[j]<=x:
        num+=1
print (num)

n,x= [int(i) for i in input().split()]
L=[int(i) for i in input().split()]
d=[0]
for i in range(1,len(L)+1):
    dd=d[i-1]+L[i-1]
    d.append(dd)
num=0
for j in range(len(d)):
    if d[j]<=x:
        num+=1
print (num)

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
n, x = map(int, input().split())
l = [int(x) for x in input().split()]

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

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

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


Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
def main():
    n, x = map(int, input().split())
    a = [int(i) for i in input().split()]
    pref = [0, a[0]]
    for i in range(1, n): pref.append(a[i] + pref[i - 1])
    ans = 0
    for val in pref:
        if val > x:
            break
        ans += 1
    print(ans)


main()


def main():
    n, x = map(int, input().split())
    a = [int(i) for i in input().split()]
    pref = [0, a[0]]
    for i in range(1, n): pref.append(a[i] + pref[i])
    ans = 0
    for val in pref:
        if val > x:
            break
        ans += 1
    print(ans)


main()


Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
N,X = map(int,input().split(' '))
L = list(map(int,input().split(' ')))
num = 0
D = 0
for i in range(N):
  D = L[i] + D
  if D <= X:
    num += 1
print(num)

N,X = map(int,input().split(' '))
L = list(map(int,input().split(' ')))
num = 1
D = 0
for i in range(N):
  D = L[i] + D
  if D <= X:
    num += 1
print(num)

Verdicts: Wrong Answer

Accepted
Problem: 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?

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


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

    

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


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

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

print(count)

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


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

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

    

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

n,x=map(int,input().split())
L = list(map(int,input().split()))
count=1
D=0
for i in L:
    D=D+i
    if D<=x:
        count+=1
    else:
        break
 
print(count)

Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
n, x = map(int, input().split())
l_list = list(map(int, input().split()))

count = 1

current = 0

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

    print(count)


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

count = 1

current = 0

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

    print(count)


import sys

input = sys.stdin.readline

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

count = 1

current = 0

for l in l_list:
    current += l
    count += 1
    if current > x:
        break

if current > x:
    print(count - 1)
else:
    print(count)


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
n,x=map(int,input().split())
a=list(map(int,input().split()))
total=0
for i in range(n):
  if total>x:
    break
  total+=a[i]
if total==sum(a):
  print(n+1)
else:
  print(i+1)

n,m=map(int,input().split())
a=list(map(int,input().split()))
ans=0
for i in range(n):
  ans+=a[i]
  if ans>m:
    break
if ans<=m:
  print(n+1)
else:
  print(i+1)

Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
from itertools import accumulate


def solve(string):
    n, x, *l = map(int, string.split())
    return str(len(list(filter(lambda a: a <= x, list(accumulate(l))))) + 1)


if __name__ == '__main__':
    print(solve(input()))


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

bounces = 1
location = 0
for l in L:
    location += l
    if location > X:
        break
    bounces += 1
print(bounces)


Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
[n,x]=[int(i) for i in input().split()]
l=[int(i) for i in input().split()]
sum=int(0)
count = int(0)

while count<n && sum+l[count]<=x:
    sum=sum+l[count]
    count=count+1

print(count+1)


[n,x]=[int(i) for i in input().split()]
l=[int(i) for i in input().split()]
sum=int(0)
count = int(1)

while sum+l[count-1]<=x:
    sum=sum+l[count-1]
    count=count+1
    print(sum)
    print(count)


print(count)


[n,x]=[int(i) for i in input().split()]
l=[int(i) for i in input().split()]
sum=int(0)
count = int(0)

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

print(count+1)


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
n, x = list(map(int, input().split()))
l = input()
ans = 1
cnt = 0

l_list = l.split(' ')

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

print (ans)


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

l_list = l.split(' ')

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

print (ans)


Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
n, x = list(map(int, input().split()))
l = list(map(int, input().split()))

d = [0]
total = 0
for i in range(n):
  total += l[i]
  d.append(total)
  
for i in range(n):
  if x < l[i]:
    print(i)
    quit()
         

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

d = [0]
total = 0
for i in range(n):
  total += l[i]
  d.append(total)

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

Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
N,X=map(int,input().split())
L=list(map(int,input().split()))
D=0
i=0
s=0
while D<=X or i<N:
  D+=L[i]
  s+=1
  i+=1
print(s)

S=lambda:input()
I=lambda:int(input())
L=lambda:list(map(int,input().split()))
LS=lambda:list(map(str,input().split()))

def main():
    n,x=L()
    l=L()
    ans=1
    d=0
    for i in range(n):
       d=d+l[i]
       if d<=x:
           ans+=1
    print(ans)
    

if __name__=='__main__':
    main()

Verdicts: Runtime Error

Accepted
Problem: 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?

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

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

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
import sys
inpt = sys.stdin.readline

def count(N, X, Ls):
  curr = 0
  for i in range(N):
    l_im1 = Ls[i]
    curr += l_im1
    if curr > X:
      return i
  return N

N, X = [int(d) for d in inpt().strip().split()]
Ls = [int(d) for d in inpt().strip().split()]
print(count(N, X, Ls))

import sys
inpt = sys.stdin.readline
 
def count(N, X, Ls):
  curr = 0
  if Ls[0]>X:
    return 0
  
  for i in range(N):
    l_im1 = Ls[i]
    curr += l_im1
    if curr > X:
      return i+1
  return N+1
 
N, X = [int(d) for d in inpt().strip().split()]
Ls = [int(d) for d in inpt().strip().split()]
print(count(N, X, Ls))

Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
n, x = map(int, input().split())
l = list(map(int, input().split()))

d = 0
c = 0
for i in range(n):
  d += l[i]
  if d < x:
    c += 1
  else:
    break
    
print(c)

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

d = 0
c = 0
for i in range(n):
  d += l[i]
  if d < x:
    c += 1
  else:
    break
    
print(c)

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

d = 0
c = 1

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

    
print(c)

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
n, x = map(int, input().split(' '))
ls = [i for i in map(int, input().split(' '))]
sum, bound = 0, 0
for i in range(0, n):
    sum += ls[i]
    if sum > x:
        break
    else:
        bound = i+1
print(bound)

n, x = map(int, input().split(' '))
ls = [i for i in map(int, input().split(' '))]
sum, bound = 0, 1
for i in range(0, n):
    sum += ls[i]
    if sum > x:
        break
    else:
        bound += 1
print(bound)

Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
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)

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)

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)

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

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
import itertools
import bisect

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

dl = [0] + list(itertools.accumulate(ll))

print(bisect.bisect_right(ll, x))

import itertools
import bisect

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

dl = [0] + list(itertools.accumulate(ll))

print(bisect.bisect_right(dl, x))

Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
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))

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

bounce = [0]

while bounce[-1] < x:
  bounce.append(bounce[len(bounce)-1] + ls[len(bounce)-1])

print(len(bounce))


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
else:
  print(len(bounce))


Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
n,x = map(int,input().split())
l = [int(i) for i in input().split()]
pre = 0
res = 0
for i in range(n):
  res += 1
  if pre > x:
    print(res)
    break
  pre += l[i]

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

Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
# -*- coding: utf-8 -*-


def main():
    n, x = map(int, input().split())
    lst = [input() for i in range(n)]
    print(n, x)
    print(lst)

    d = []
    for i in range(n + 1):
        if i == 0:
            d.append(0)
        else:
            d.append(d[i - 1] + int(lst[i - 1]))
    print(d)

    bound = 0

    for n, i in enumerate(d):
        if i <= x:
            bound += 1
        else:
            break
    print(bound)


if __name__ == '__main__':
    main()

# -*- coding: utf-8 -*-


def main():
    n, x = map(int, input().split())
    lst = list(map(int,input().split()))
    lst = lst[:n]
    print(n, x)
    print(lst)

    d = []
    for i in range(n + 1):
        if i == 0:
            d.append(0)
        else:
            d.append(d[i - 1] + int(lst[i - 1]))
    print(d)

    bound = 0

    for n, i in enumerate(d):
        if i <= x:
            bound += 1
        else:
            break
    print(bound)


if __name__ == '__main__':
    main()

# -*- coding: utf-8 -*-


def main():
    n, x = map(int, input().split())
    lst = [input() for i in range(n)]
    print(n, x)
    print(lst)
    
    d = []
    for i in range(n + 1):
        if i == 0:
            d.append(0)
        else:
            d.append(d[i - 1] + int(lst[i - 1]))
    print(d)
    
    bound = 0
    
    for n, i in enumerate(d):
        if i <= x:
            bound += 1
        else:
            break
    print(bound)




if __name__ == '__main__':
    main()

# -*- coding: utf-8 -*-


def main():
    n, x = map(int, input().split())
    lst = list(map(int,input().split()))
    lst = lst[:n]

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

    bound = 0

    for n, i in enumerate(d):
        if i <= x:
            bound += 1
        else:
            break
    print(bound)


if __name__ == '__main__':
    main()

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
n,x = (int(x) for x in input().split())
l=list(map(int,input().split()))
k=1
d=0

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

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

Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = 0
d = 0
for i in b:
  d += i
  if d <= a[1]:
    c += 1
print(c)

a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = 1
d = 0
for i in b:
  d += i
  if d <= a[1]:
    c += 1
print(c)


Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
N, X=map(int, input().split())
L=list(map(int, input().split()))

length=0
counter=0
while l<=X:
  length+=L[counter]
  counter+=1
  
print(counter)

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

l=0
counter=0
while l<=X:
  l+=L[counter]
  counter+=1

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

l=0
counter=0
while l<=X:
  l+=L[counter-1]
  counter+=1

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

N=temp[0]
X=temp[1]

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

ind=1
while np.sum(L[:ind])<=X and ind<N:
  ind+=1
  
print(ind)

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

length=0
counter=0
while l<=X:
  length+=L[counter]
  counter+=1

N, X=map(int, input().split())
L=list(map(int, input().split()))
L=[0]+L
 
l=int(0)
counter=int(0)
while l+L[counter]<=X and counter<=N:
  l+=L[counter]
  counter+=int(1)
  if counter==N+1:
    break
  
print(counter)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
n,x=map(int,input().split())
l=list(map(int,input().split()))
list=[0]
cnt=0
for i in l:
  i=i+list[cnt]
  list.append(i)
  cnt+=1
print(list)
ans=0
for i in list:
  if i>=x:
    ans+=1
print(ans)
  
  
  

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

Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
in1 = list(map(int, input().split()))
N = in1[0]
X = in2[1]

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

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

in1 = list(map(int, input().split()))
N = in1[0]
X = in1[1]
 
L = list(map(int, input().split()))
L.append(0)
L.append(0)
D = 0
overflow = False
for i in range(1, N+2):
  if X < D:
    print(i-1)
    overflow = True
    break
  if X == D:
    print(i)
    overflow = True
    break
  D = D + L[i-1]

if not overflow:
  print(N+1)

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
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)

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

d = 0
ans = 0

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

return(ans)

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

d = 0
ans = 0

if d <= x:
    ans = 1
else:
    ans = 0

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

print(ans)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
def next_pos(D,L):
    return D+L
    
N, X = map(int,input().split(" "))
L = [int(i) for i in input().split(" ")]
D = 0
count = 0
i = 0

while(D<=X or i<N):
    D = next_pos(D,L[i])
    count+=1
    i+=1
    
print(count)

N, X = map(int,input().split(" "))
L = [int(i) for i in input().split(" ")]
D = 0
count = 1
for i in range(N):
    D+=L[i]
    if D<=X:
        count+=1
    
print(count)

Verdicts: Runtime Error

Accepted
Problem: 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?

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

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


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)

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

Verdicts: Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
N = [int(i) for i in input().split()]
K = [int(i) for i in input().split()]
s = 0
c = 1
for i in K:
	if (i + s) <= N[1]
  		c += 1
      	s += i + s
	else
    	break
print(c)


N = [int(i) for i in input().split()]
K = [int(i) for i in input().split()]
s = 0
c = 1
for i in K:
    s += i
    if s > N[1]:
        break
    else:
        c += 1
print(c)

Verdicts: Runtime Error

Accepted
Problem: 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?

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

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

Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
N,X = map(int,input().split())

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

count=1

kazu=0

for i in hr :
    
    kazu += i 
    
    if i <= X:
        count +=1

print(count)

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

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

count=1

kazu=0

for i in hr :
    
    kazu += i 
    
    if kazu <= X:
        count +=1

print(count)
        

Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
#ABC130B-Bounding.py

import sys
from functools import lru_cache

def main():
    N, X = list(map(int,sys.stdin.readline().split()))
    L = list(map(int,sys.stdin.readline().split()))
    print(L)

    @lru_cache(maxsize=None)
    def D(i):
        if i == 1:
            return 0
        elif i <= N+1:
            return D(i-1) + L[i-2]
    for i in range(1,N+2):
        if D(i) > X:
            print(i-1)
            break



if __name__ == "__main__":
    main()


#ABC130B-Bounding.py

import sys
from functools import lru_cache

def main():
    N, X = list(map(int,sys.stdin.readline().split()))
    L = list(map(int,sys.stdin.readline().split()))

    @lru_cache(maxsize=None)
    def D(i):
        if i == 1:
            return 0
        elif i <= N+1:
            return D(i-1) + L[i-2]

    for i in range(1,N+2):
        if D(i) > X:
            print(i-1)
            break
    else:
        print(N+1)



if __name__ == "__main__":
    main()


Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
n, x = map(int, input().split())
l = [int(i) for i in input().split()]
d = 0
ans = 1
for i in range(n):
  d += l[i]
  if d <= x:
    ans += 1
  else:
    break

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

Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
n,x = map(int,input().split())
l = list(map(int,input().split()))
L=0
for i in range(n):
    L += l[i]
    if L > x:
        print(i+1)
        return()

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

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
n, x = map(int,input().split())
l = list(map(int, input().split()))
s = 0
count = 1
for i in L:
    s += i
    if s > x:
        break
    count += 1
print(count)

n, x = map(int,input().split())
l = list(map(int, input().split()))
s = 0
count = 1
for i in l:
    s += i
    if s > x:
        break
    count += 1
print(count)


Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
N,X=map(int,input().split())
List = list(map(int, input().split()))
height = 0
res = 1
def checkF(k,x):
  if k>=x:
    return True
  else:
    return False
    
for i in range(N):
  if checkF(height,X):
    break
  height += List[i]
  res +=1
print(res)
  

N,X=map(int,input().split())
List = list(map(int, input().split()))
height = 0
res = 1
def checkF(k,x):
  if k>x:
    return True
  else:
    return False
    
for i in range(N):
  height += List[i]
  res +=1
  if checkF(height,X):
    res = res-1
    break
print(res)

Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
N,X=map(int,input().split())
L=list(map(int,input().split()))
D=[0]
cnt=0
for i in L:
  D.append(D[-1]+i)
for i in D:
  if i<=X:
    cnt+=1 

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

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

N,X=map(int,input().split())
L=list(map(int,input().split()))
D=[0]
cnt=0
for i in L:
  D.append(D[-1]+i)
for i in D:
  if i<=X:
    cnt+=1
print(cnt)

Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
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)


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

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


Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
n ,x = map(int, input().split())
l = list(map(int, input().split()))

sum = 0

for i in range(2,n+2):
  if sum >= x:
    break
  else:
    sum += l[i-2]
    print(sum)

    
print(i-1)

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

sum = 0

for i in range(2,n+2):
  if sum > x:
    break
  else:
    sum += l[i-2]
   # print(sum)

    
print(i-1)

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

sum = 0

for i in range(2,n+2):
  if sum > x:
    break
  else:
    sum += l[i-2]
    print(sum)

    
print(i-1)

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

sum = 0

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

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

d = 0
result = 0

for i in range(n):
  d += l[i]
  if d <= x:
    result = i + 2 # 2 is offset

    
print(result)

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
n,y=map(int,input().split())
lst=list(map(int,input().split())) 
lst=[0]+lst
cnt=0 
sum_lst=0 
for i in range(n+1): 
	sum_lst+=lst[i]
	if sum_lst>=y:
		cnt+=1
print(cnt-1)

n,y=map(int,input().split())
lst=list(map(int,input().split())) 
lst=[0]+lst
cnt=0 
sum_lst=0 
for i in range(n+1): 
	sum_lst+=lst[i]
	if sum_lst<=y:
		cnt+=1
print(cnt-1)


n,y=map(int,input().split())
lst=list(map(int,input().split())) 
lst=[0]+lst
cnt=0 
sum_lst=0 
for i in range(n+1): 
	cnt+=1 
	sum_lst+=lst[i]
	if sum_lst>y: 
		print(cnt) 
		break

n,y=map(int,input().split())
lst=list(map(int,input().split())) 
lst=[0]+lst
cnt=0 
sum_lst=0 
for i in range(n+1): 
	sum_lst+=lst[i]
	if sum_lst<=y:
		cnt+=1
print(cnt)

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 25 12:46:40 2019

@author: YudNK
"""

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

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 25 12:46:40 2019

@author: YudNK
"""

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

Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
n,x=map(int,input().split())
l=list(map(int,input().split()))
d=0
i=1
cnt=0
while d<=x:
  cnt+=1
  d+=l[i-1]
  
print(cnt)

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

  
print(cnt)

Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
N,X=map(int,input().split())
L=list(map(int,input().split()))
D=[]
D.append(0)
for i in range(1,N+2):
  D.append(D[i-1]+L[i-1])
s=0
for j in D:
  if j<=X:
    s+=1
print(s)

N,X=map(int,input().split())
L=list(map(int,input().split()))
D=[]
D[0]=0
for i in range(1,N+2):
  D.append(D[i-1]+L[i-1])
s=0
for j in range(len(D)):
  if D[j]<=X:
    s+=1
print(s)

N,X=map(int,input().split())
L=list(map(int,input().split()))
D[0]=0
for i in range(1,N+1):
  D.append(D[i-1]+L[i-1])
s=0
for j in range(0,N+1):
  if D[j]<=X:
    s+=1
print(s)

N,X=map(int,input().split())
L=list(map(int,input().split()))
D=[]
D[0]=0
for i in range(1,N+2):
  D.append(D[i-1]+L[i-1])
s=0
for j in range(0,N+1):
  if D[j]<=X:
    s+=1
print(s)

N,X=map(int,input().split())
L=list(map(int,input().split()))
D=[]
D[0]=0
for i in range(1,N+1):
  D.append(D[i-1]+L[i-1])
s=0
for j in range(0,N+1):
  if D[j]<=X:
    s+=1
print(s)

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

D=[]
D.append(0)
for i in range(1,N+2):
  D.append(D[i-1]+L[i-1])
s=count(j for j in D if j<=X)
print(s)

N,X=map(int,input().split())
L=list(map(int,input().split()))
D=[]
D[0]=0
for i in range(1,N+1):
  D.append((D[i-1]+L[i-1]))
s=0
for j in range(0,N+1):
  if D[j]<=X:
    s+=1
print(s)

N,X=map(int,input().split())
L=list(map(int,input().split()))
D=[]
D[0]=0
for i in range(1,N+1):
  t=D[i-1]+L[i-1]
  D.append(t)
s=0
for j in range(0,N+1):
  if D[j]<=X:
    s+=1
print(s)

N,X=map(int,input().split())
L=list(map(int,input().split()))
D=[]
D.append(0)
for i in range(1,N+1):
  D.append(D[i-1]+L[i-1])
s=0
for j in range(0,N+1):
  if D[j]<=X:
    s+=1
print(s)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
def mapt(fn, *args):
    return tuple(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))


def main():
    n, x = Input()
    l = Input()
    d = list(range(n+1))
    ans = 0

    for i in range(1, n+1):
        d[i] = d[i-1] + l[i-1]

    for i in d:
        if i <= x: ans += 1

    print(ans)

from collections import defaultdict


def mapt(fn, *args):
    return tuple(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))


def main():
    n, x = Input()
    l = Input()
    d = defaultdict(int)
    d[0] = 0
    ans = 0

    for i in range(1, n+1):
        d[i] = d[i-1] + l[i-1]

    for i in d.values():
        if i <= x: ans += 1

    print(ans)

main()

Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
n, x = map(int, input().split())
l_array = [int(x) for x in input().split()]
d = 0
cnt = 0
while d <= x:
  d = d+l_array[d]
  cnt += 1
print(cnt)

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

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
N,X = map(int, input().split())
L = [x for x in map(int, input().split())]
accumL = [sum(L[:x]) for x in range(len(L)+1)]
TF = [i < X for i in accumL]
print(str(TF.index(False)+ 1))

N,X = map(int, input().split())
L = [x for x in map(int, input().split())]
accumL = [sum(L[:x]) for x in range(len(L)+1)]
TF = [i < X for i in accumL]
print(TF.index(False) + 1)

N,X = map(int, input().split())
L = [map(int,input().split())]
accumL = []
for n in range(len(L)):
  accumL.append(sum(L[:n+1])
s = [x < 4 for x in accumL]
print(str(s.index(False) + 1))

N,X = map(int, input().split())
L = [x for x in map(int, input().split())]
accumL = [sum(L[:x]) <= X for x in range(len(L)+1)]
if accumL[-1] == True:
  print(N + 1)
else:
  print(accumL.index(False))


Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
N,X = map(int,input().split())
L = list(map(int,input().split()))
D = [0]*(N+1)
x = 0
for i in range(1,N+2):
  D[i] = D[i-1]+L[i-1]
while D[x] <= X:
  x += 1
print(x)

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

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
n,x=map(int,input().split())
L=list(map(int,input().split()))
p=0
ans=1
for i in range(n):
        p+=L[i]
        ans+=1 if p<=x else continue
print(ans)

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):
    if a[i]<=x:
        print(i)
        exit()

import bisect
n,x=map(int,input().split())
L=list(map(int,input().split()))
p=0
ans=1
for i in range(n):
        p+=L[i]
        if p<=x:
                ans+=1
print(ans)

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: 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?

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


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


Verdicts: Runtime Error

Accepted