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


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)
    

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)
    

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

count=0
dist=0

i=0
while dist<=X and count<=N:
    count+=1
    dist+=L[i]
    #print(dist)

print(count)

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

count=0
dist=0

i=0
while dist<=X or i<N:
    count+=1
    dist+=L[i]
    i+=1
    #print(dist)

print(count)

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

count=0
dist=0
L.append(0)

i=0
while dist<=X and count<=N:
    dist+=L[count]
    count+=1
    #print(dist)

print(count)

Verdicts: Wrong Answer

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):
a = input().split(" ")
l = input().split(" ")
x = int(a[1])
y = 0
num = 1
for i in l:
    y += i
    if y <= x:
        num += 1
    else:
        break
print(num)

a = input().split(" ")
l = input().split(" ")
x = int(a[1])
y = 0
num = 1
for i in l:
    y += int(i)
    if y <= x:
        num += 1
    else:
        break
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):
x=int(input().split()[1])
l=[int(x) for x in input().split()]
s=[1 for i in [0]*len(l) if sum(l[:i])<=x]
print(sum(s))

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

n, x = map(int, input().split())
l = list(map(int,input().split())) + [0]
cnt = 0
if sum(l) <= x:
    print(n+1)
    exit()
for i in range(n + 1):
    if cnt > x:
        break
    cnt += l[i]
print(i)

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 = 1
while X - D[i-1] >= 0:
  D.append(D[i-1]+ L[i-1])
  i += 1
  cnt += 1
  if i == N:
    break
print(cnt)

N, X = map(int, input().split())
L = list(map(int, input().split()))
D = [0]
cnt = 1
for i in range(1,N+1):
  D.append(D[i-1]+L[i-1])
  if X >= D[i]:
    cnt += 1
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=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)

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

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(N+1):
    sum += l[i]
    if sum>X:
        ans = i+1
print(ans)


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

sum=0
for i in range(N):
    sum += l[i]
    if sum>X:
        ans = i+1
print(ans)


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

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


N,X = map(int,input().split())
l=[0]
l.append(list(map(int,input().split())))

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

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

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


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


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


Verdicts: Runtime Error

Runtime Error

Wrong Answer

Runtime Error

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):
# -*- coding: utf-8 -*-
"""
AtCoder A
"""

import sys, math, random
import numpy as np

# N = int(input())
# A = list(map(int,input().split())) # N row 1 column
# A = [int(input()) for _ in range(N)] # 1 row N column
# S = str(input()) # str(input()) == input() -> 'abc'
# S = list(input()) # abc -> ['a','b','c']
# S.replace('ABC','X') # "testABCABC" -> "testXX"
 
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]
 
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()


def main():
    N, X = list(map(int,input().split()))
    L=LI()
    L1=0
    out=1
    for l in L:
        D=L1+l
        print(D)
        if D<X+1:
            out+=1
        L1=D
    print(out)
    
if __name__ == "__main__":
    main()

# -*- coding: utf-8 -*-
"""
AtCoder A
"""

import sys, math, random
import numpy as np

# N = int(input())
# A = list(map(int,input().split())) # N row 1 column
# A = [int(input()) for _ in range(N)] # 1 row N column
# S = str(input()) # str(input()) == input() -> 'abc'
# S = list(input()) # abc -> ['a','b','c']
# S.replace('ABC','X') # "testABCABC" -> "testXX"
 
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]
 
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()


def main():
    N, X = list(map(int,input().split()))
    L=LI()
    L1=0
    out=1
    for l in L:
        D=L1+l
        # print(D)
        if D<X+1:
            out+=1
        L1=D
    print(out)
    
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 = list(map(int, input().split()))

ans = 0
count_n = 1
for n in range(N):
    ans += L[n]
    if ans > X:
        count_n += 1

print(count_n)

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

sum_l = 0
count_n = 1
for n in L:
    sum_l += n
    if sum_l <= X:
        count_n += 1

print(count_n)

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
count = 0

for i in L:
    D += i
    if D <= X:
        count += 1
print(count)
  

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

L = list(map(int, input().split()))
D = 0
count = 1

for i in L:
    D += i
    if D <= 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):
N, X = map(int,input().split())
L = map(int,input().split())
ans = 0
now = 0
for i in L:
  now += i
  if now >= X:
    break
  ans +=1
print(ans)

N, X = map(int,input().split())
L = map(int,input().split())
ans = 0
now = 0
for i in L:
  now += i
  ans +=1
  if now > X:
    break
else:
  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):
n,x = map(int,input().split())
l = list(map(int,input().split()))
iti = 0
cnt = 1
for i in range(n):
    iti += l[i]
    if(iti<=x):
        cnt += 1
print(cnt,iti)

n,x = map(int,input().split())
l = list(map(int,input().split()))
iti = 0
cnt = 1
for i in range(n):
    iti += l[i]
    if(iti<=x):
        cnt += 1
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):
inp=input().split(' ')
L=input().split(' ')
n=int(inp[0])
l=0;
count=1;
for i in range(n):
  l+=int(L[i])
  if l<=int(inp[1]):
    count+=1
  else:
    print(count)
if count==n+1 and l>int(inp[1]):
    print(n)

inp=input().split(' ')
L=input().split(' ')
n=int(inp[0])
l=0;
count=1;
for i in range(n):
  l+=int(L[i])
  if l<=int(inp[1]):
    count+=1
  else:
    print(count)
if count==n+1:
  print(n+1)


inp=input().split(' ')
L=input().split(' ')
n=int(inp[0])
l=0;
count=1;
for i in range(n):
  l+=int(L[i])
  if l<=int(inp[1]):
    count+=1
  else:
    print(count)
if count==n+1 and l<=int(inp[1]):
    print(n+1)

inp=input().split(' ')
L=input().split(' ')
n=int(inp[0])
l=0;
count=1;
for i in range(n):
  l+=int(L[i])
  if l<=int(inp[1]):
    count+=1
  else:
    print(count)
if count==n+1 and l<=int(inp[1]):
    print(n+1)

inp=input().split(' ')
L=input().split(' ')
n=int(inp[0])
l=0;
count=1;
for i in range(n):
  l+=int(L[i])
  if l<=int(inp[1]):
    count+=1
  else:
    print(count)
if count==n+1 and l>int(inp[1]):
    print(n+1)

inp=input().split(' ')
L=input().split(' ')
n=int(inp[0])
l=0;
count=1;
for i in range(n):
  l+=int(L[i])
  if l<=int(inp[1]):
    count+=1
print(count)

    

Verdicts: 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, lim = map(int, input().split())
l = list(map(int, input().split()))

s = 0
c = 1
for i in l:
  s += i
  c += 1
  if (s > lim):
    break

print(c)

N, lim = map(int, input().split())
l = list(map(int, input().split()))

s = 0
c = 1
for i in l:
  s += i
  if (s > lim):
    break
  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())
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)


n, x = map(int, input().split())
lList = [int(i) for i in input().split()]
point = 0
count = 0
flag = 0
for l in lList:
    count = count + 1
    point = point + l
    if point == x:
        if count == 1:
            print(count)
        else:
            print(count+1)
        flag =1
        break
    elif point > x:
        print(count)
        flag =1
        break
if flag == 0:
    print(count+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):
N, X = map(int, input().split())
L_list = list(map(int, input().split()))
D = 0
ans = 1
for i in range(N):
    if D > X:
        break
    else:
        D += L_list[i]
        ans += 1
print(ans)

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

lis = list(map(int,input().split()))
count = 1
sm = 0
for l in lis:
  sm += l
  count += 1
  if sm >= X:
    break
print(count)

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

lis = list(map(int,input().split()))
count = 1
sm = 0
for l in lis:
  sm += l
  if sm > 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()))

a = 1

s = 0
for i in l:
    print(a, s, i)
    s = s + i
    if s > x: break
    a = a + 1

print(a)



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

a = 1

s = 0
for i in l:
    s = s + i
    if s > x: break
    a = a + 1

print(a)



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

ans=0
d=0

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

if(i=n-1):
    ans-=1
print(ans)


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

a=1
d=0

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


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 numpy as np

A = input()
B = input()

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

print(jump)

import numpy as np

A = input()
B = input()

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

print(jump)

import numpy as np

A = input()
B = input()

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

L_sum = 0
jump = 1

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

print(jump)




import numpy as np

A = input()
B = input()

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

L_sum = 0
jump = 1

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

print(jump)




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

print(ans)

n, x= map(int, input().split())
l = list(map(int, input().split()))
ans = 1
tmp = 0
for i in range(n):
  tmp += l[i]
  if x >= tmp:
    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()))
a = 0
for i in range(n):
    a += l[i]
    if a > x:
        print(i+1)
        exit()
    else:
        print(n+1)

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

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

if sum(l)<=x:
  print(n+1)
  exit()

i=1
d=0
while d<=x:
    d+=l[i-1]
    i+=1
print(i)

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

i=1
d=0
while d<=x and i<=n:
    d+=l[i-1]
    i+=1
print(i)

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

if sum(l)<=x:
  print(n+1)
  exit()

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

Verdicts: 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(map(int ,input().split()))
old_d = 0
count = 1
for i in range(1 ,n+1):
    new_d =old_d +l[i-1]
    old_d = new_d
    print(old_d)
    if new_d <= x:
        count +=1
print(count)

n,x = map(int ,input().split())
l = list(map(int ,input().split()))
old_d = 0
count = 1
for i in range(1 ,n+1):
    new_d =old_d +l[i-1]
    old_d = new_d
    if new_d <= 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):
n, x = map(int,input().split())
l = list(map(int,input().split()))
ans = 1
tmp = 0
for i in range(n):
     tmp += l[i]
     if tmp <= x:
             ans += 1
     print(ans)

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

L = [map(int,input().split())]

ans = int(1)
t = int(0)
for i in range(n):
    t += L[i]
    if t <= x:
        ans += 1

print(ans)

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

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

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

print(count

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

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

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

n,x=map(int,input().split())
L=list(map(int,input().split()))
d=0
c=0
for i in range(1,n+2):
    if d<=x:
        c+=1
    if i<n+1:
        d=d+L[i-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):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

def main():
    N, X = list(map(int,readline().split()))
    L = map(int,readline().split())
    sum = 0
    cnt = 1
    for n in N:
        sum += n
        if sum <= X:
            cnt += 1
    print(cnt)

    return

if __name__ == '__main__':
    main()



import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

def main():
    N, X = list(map(int,readline().split()))
    L = map(int,readline().split())
    sum = 0
    cnt = 1
    for l in L:
        sum += l
        if sum <= X:
            cnt += 1
    print(cnt)

    return

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=(list(map(int,input().split()))
cut==1
for i in range(n):
   ans=sum(l[:i])
   if ans<=x :
      cut+=1
   else:
      cut+=0
print(cut)

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

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

n,x = map(int,input().split())
l = list(map(int,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  = (int(i) for i in input().split()) 
L = [int(i) for i in input().split()]
D = 0
if X < L[0]:
  print(1)
else:
  for i in range(N):
    D = D + L[i]
    if D >= X:
      break
  print(i+2)

N , X  = (int(i) for i in input().split()) 
L = [int(i) for i in input().split()]
D = 0
if X < L[0]:
  print(1)
elif sum(L) <= X:
  print(N+1)
else:
  for i in range(N):
    D = D + L[i]
    if D > X:
      break
  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):
n=0
x=0
l=[]
d=0
c=0

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

n=all_input[0]
x=all_input[1]

for i in range(2,len(all_input)):
    l.append(all_input[i])

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

print(c)
        

d=0
c=0

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

for j in range(len(l)):
    if d<=x:
        d+=int(l[j])
        c+=1 

if d <= x:
    print(n+1)
else:
    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 = list(map(int, input().split()))
l = list(map(int,input().split()))

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

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

z = 0
ans = n+1
for i in range(n):
  if z <= x:
    z += l[i]
    if z > x:
      ans = i+1
      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())
List=list(map(int,input().split()))
a = 0
i = 0
while a < X:
    a = a + List[i]
    i = i + 1
print(i

N,X= map(int,input().split())
List=list(map(int,input().split()))
List.append(0)
a = 0
i = 0
while a <= X and i <= N:
    a = a + List[i]
    i = i + 1
print(i)

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):
a = input().split()
n = int(a[0])
x = int(a[1])
l_str_list = input().split()
d = 0
answer = 0

for i in n:
  d += int(l_str_list[i])
  if d > x:
    answer = i + 1
    break;
print(answer)

a = input().split()
n = int(a[0])
x = int(a[1])
l_str_list = input().split()
d = 0
answer = n + 1

for i in range(n):
  d += int(l_str_list[i])
  if d > x:
    answer = i + 1
    break
  if d == x:
    answer = i + 2
    break
print(answer)


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):
#coding:utf-8

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

ans = 0
d = 0 
for i in l:
    if d > x:
        break
    ans += 1
    d += int(i)

# if ans == len(l):
#     ans += 1

print(ans+1)

#coding:utf-8

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

l.insert(0,0)

# print(l)

ans = 0
d = 0 
for i in l:
    d += i
    if d > x:
        break
    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):
n,x=map(int,input().split())
Y = list(map(int,input().split()))
Z = [0]*n
a = 0
for i in range(n):
  a +=Y[i]
  Z[i]=a
import bisect
print(2+bisect.bisect_left(Z,x))

n,x=map(int,input().split())
Y = list(map(int,input().split()))
Z = [0]*n
a = 0
for i in range(n):
  a +=Y[i]
  Z[i]=a
import bisect
print(1+bisect.bisect_left(Z,x+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):
import logging
 
logging.basicConfig(level=logging.INFO, format="%(message)s")
logging.disable(logging.CRITICAL)
 
N, X  = (int(x) for x in input().split())
L = list(int(x) for x in input().split())
 
logging.info(L)
 
length = 0
counter = 1
if X < L[0]:
    print(1)
else:
    for i in L:
        length += i
        if length > X or counter == N:
            break
        counter += 1
       
    print(counter

import logging

logging.basicConfig(level=logging.INFO, format="%(message)s")
logging.disable(logging.CRITICAL)

N, X  = (int(x) for x in input().split())
L = list(int(x) for x in input().split())

logging.info(L)

length = 0
counter = 1

for i in L:
    length += i
    if length <= X:
        counter++
    
print(counter)


    import logging
     
    logging.basicConfig(level=logging.INFO, format="%(message)s")
    logging.disable(logging.CRITICAL)
     
    N, X  = (int(x) for x in input().split())
    L = list(int(x) for x in input().split())
     
    logging.info(L)
     
    length = 0
    counter = 1
     
    if X < L[0]:
        print(1)
    else:
        for i in L:
            length += i
            if length >= X or counter == N:
                break
            counter += 1
        
        print(counter)

import logging

logging.basicConfig(level=logging.INFO, format="%(message)s")
logging.disable(logging.CRITICAL)

N, X  = (int(x) for x in input().split())
L = list(int(x) for x in input().split())

logging.info(L)

length = 0
counter = 1

for i in L:
    length += i
    if length <= X:
        counter += 1
    
print(counter)


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

n,x=map(int,input().split())
l=list(map(int,input().split()))
ns=1
dis=0
i=0
while dis<=x:
  
  dis+=l[i]
  i+=1
  if dis>x:
    break
  elif i==n:
    ns+=1
    break
  ns+=1
print(ns)


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
ans = 0
for i in l:
  sum += i
  if sum <= x:
    ans += 1
    
  

n,x = map(int,input().split())
l = list(map(int,input().split()))
sum = 0
ans = 0
for i in l:
  sum += i
  if sum <= x:
    ans += 1
print(ans+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())

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

tmp = 0
for i in range(100):
    tmp += l_list[i]
    if tmp > x:
        break

if tmp =< x:
    print(101)
else:
    print(i+1)


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

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

tmp = 0
for i in range(n):
    tmp += l_list[i]
    if tmp > x:
        break

if tmp <= x:
    print(101)
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):
n,x=map(int, input().split())
l =list(map(int,input().split()))

sum = 0
ans = 0

while sum < x or ans<n+1:
    sum+=l[ans]
    ans += 1
    
print(ans)

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

sum = 0
ans = 0

while sum < x or ans<n:
    sum+=l[ans]
    ans += 1
    
print(ans)

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

sum = 0
ans = 0

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

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

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

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

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):
#bin/usr/env python3

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

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





#bin/usr/env python3

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

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





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())
a = list(map(int,input().split()))
c = 0
b = 0
for i in a:
    b = i+b
    if b <= x:
        c+=1
print(c)

n,x = map(int,input().split())
a = list(map(int,input().split()))
c = 1
b = 0
for i in a:
    b = i+b
    if b <= 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):
A, B = input().split()
C = input().split()
count = 0
step = 0
for i in range(int(A)):
  step += int(C[i])
  if step > int(B):
    break
  count += 1
print(count)

A, B = input().split()
C = input().split()
count = 1
step = 0
for i in range(int(A)):
  step += int(C[i])
  if step > int(B):
    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):
a,b=map(int,input().split())
M = input()
l = M.split()
ll = list(map(int, l))
q=0
ans=1
for i in range(a):
  ai +=1
  q += ll[i]
  if q <= b :
    ans += 1
print(ans)


a,b=map(int,input().split())
M = input()
l = M.split()
ll = list(map(int, l))
q=0
ans=1
for i in range(a):
  q += ll[i]
  if q <= b :
    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 = [int(i) for i in input().split()]
x = 0
ct = 0
for i in L:
  x += i
  if x > X:
    print(ct)
    break
  else:
    ct += 1

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

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

N,X=map(int, input().split())
L=list(map(int, input().split()))
s=[x for x in range(len(L)+1) if sum(L[:x])<=X]
if N+1>=len(s):
  print(len(s))
else:
  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())
L = list(map(int, input().split()))
d = 0
for i in range(n+1):
	if i == 0:
		d = 0
	else:
		print(i, d)
		d += L[i-1]
	if d > x:
		i -= 2
print(i+1)

n, x = map(int, input().split())
L = list(map(int, input().split()))
d = 0
bound = 1
for l in L:
	d += l
	if d > X:
		break
	bound += 1
print(bound)

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

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

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

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

Verdicts: Wrong Answer

Runtime Error

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(map(int,input().split()))
ans = 1
for i in range(n):
  if x >= sum(l[:i]):
    ans += 1
print(ans)

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

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

def main():
    n,x = map(int, input().split())
    l = list(map(int, input().split()))
    ans = 1
    
    while True:
        i = 0
        max += l[i]
        if max < x:
            ans += 1
            
        i += 1
        
    print(ans)

main()

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

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

        i += 1

    print(ans)

main()


def main():
    n,x = map(int, input().split())
    l = list(map(int, input().split()))
    ans = 1
    
    while True:
        i = 0
        max = l[i] + l[i+1]
        if max < x:
            ans += 1
            
        i += 1
        
    print(ans)

main()

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

    #while True:
        #i = 0
        #max += l[i]
        #if max < x:
            
        #i += 1

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

main()

Verdicts: Runtime Error

Runtime Error

Time Limit Exceeded

Time Limit Exceeded

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())
w = list(map(int, input().split()))

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


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

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

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

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

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):
import sys

input = sys.stdin.readline


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


if __name__ == "__main__":
    main()

import sys

input = sys.stdin.readline


def main():
    n, x = [int(i) for i in input().split()]
    l_list = [int(i) for i in input().split()]
    n += 1
    d = 0
    num = 1
    for i in range(1, n):
        d = d + l_list[i - 1] * (i <= n + 1)
        if d > x:
            break
        num += 1
    print(num)


if __name__ == "__main__":
    main()

Verdicts: Runtime Error

Accepted