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):
line1 = input().split()
n = int(line1[0])
x = int(line1[1])
L = list(map(int,input().split()))

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



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

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


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

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

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()))
c = 0
for i in L:
  if L <= X:
    c = c + 1
  elif L > X:
    print(c)
    

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

cnt = 1
D_a = 0
D_b = 0
for i in range(N):
    D_a = D_b + L[i]
    D_b = D_a
    if D_a > X:
        print(cnt)
    else:
        cnt += 1


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


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

cnt = 1
D = 0
for i in L:
    D += i
    if D > X:
        break
    else:
        cnt += 1
print(cnt)

Verdicts: 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):
n,m = map(int,input().split())
lis = list(map(int,input().split()))
ans = 1
now = 0
for num in lis:
  now += num
  if now > m:
    exit()
  else:
    ans += 1
print(ans)

n,m = map(int,input().split())
lis = list(map(int,input().split()))
ans = 1
now = 0
for num in lis:
  now += num
  if now > m:
    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())
L = list(map(int, input().split()))
d = 0
ans = 1
for i in range(N):
  d += L[i]
  if d <= X:
    ans += 1

print(ans)

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

print(ans)

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

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

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

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

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

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

N, X = LI()
L = LI()


def main():
    ans = X // L
    print(ans)


if __name__ == "__main__":
    main()


LI = lambda: list(map(int, input().split()))

N, X = LI()
L = LI()


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

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

#include <bits/stdc++.h>
using namespace std;

int main () {
    int n, x;
    cin >> n >> x;
    int count = 1;
    int sum = 0;
    int l;
    for (int i=0; i < n; i++) {
        cin >> l;
        sum += l;
        if (sum <= x) {
            count += 1;
        }
    }
    cout << count << endl;
}

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


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

Verdicts: Wrong Answer

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):
import sys
n, x = map(int, sys.stdin.readline().split())
llist =list(map(int, sys.stdin.readline().split()))

d = 0
ans = 1
for l in llist:
  ans += 1
  d += l
  if d >= x:
    break
  
  if ans >= n+1:
    print(n+1)
    exit()
print(ans)

import sys
n, x = map(int, sys.stdin.readline().split())
llist =list(map(int, sys.stdin.readline().split()))

d = 0
ans = 1
for l in llist:
  ans += 1
  d += l
  if d > x:
    ans -= 1
    break
  elif d == x:
    break
  
  if ans >= n+1:
    print(n+1)
    exit()
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=0
a=0
for i in range(n):
    if a<=x:
        ans+=1
        a+=l[i]
        print(a)
    else:
        break
if sum(l)<=x:
    ans+=1
print(ans)

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

X,L=map(int,input().split())
N=input().split()
d=0
ans=1
for i in N:
  d+=int(i)
  if d<=L:
    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):
info = map(int, input().split(' '))
N, X = info[0], info[1]
info = map(int, input().split(' '))
len = 0

count = 1

for for1 in info:
  len += for1
  if len <= X:
    count += 1
  else:
    break

print(count)

# -*- coding: utf-8 -*-
info = list(map(int, input().split(' ')))
N, X = info[0], info[1]
info = list(map(int, input().split(' ')))
len = 0

count = 1

for for1 in info:
  len += for1
  if len <= X:
    count += 1
  else:
    break

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

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

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

a = 0
for i in range(n):
    a = a + l[i]
    #print(a)
    if x == a:
        print(i+1+1)
        break
    elif x < a:
        print(i+1)
        break
    else:
        continue
else:
    print(n+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()))
d=0
dlist=[]
dlist.append(0)
for i in range(2,n+2):
    d=d+l[i-1]
    if d <= x:
        dlist.append(d)
print(len(dlist))


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


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 bisect

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

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

print(bisect.bisect_right(L, X))

import bisect

N, X = map(int, input().split())
L = [0]+list(map(int, input().split()))

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

print(bisect.bisect_right(L, 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):
x,a=map(int,input().split())
b=0
c=0
A = [int(input()) for _ in range(x)]
while b<=a:
    b=b+A[c]
    c+=1
print(c)

x,a=map(int,input().split())
b=0
c=0
A=[int(input()) for _ in range(x)]
while b<=a:
    b=b+A[c]
    c+=1
print(c)

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

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()))
count = 0
for a in l:
  count += 1
  if(x-a) < 0:
    break

print(count)

n, x = map(int, input().split())
l = list(map(int, input().split()))
count = 1
for a in l:
  if(x-a) < 0:
    break
  count += 1
print(count)

n, x = map(int, input().split())
l = list(map(int, input().split()))
count = 1
for a in l:
  if(x-a) < 0:
    break
  x -= a
  count += 1
print(count)

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):
import sys
input = sys.stdin.readline

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

import sys
input = sys.stdin.readline

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:
        print(i+1)
        sys.exit()
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):
c = 0
b = 0
for an in range(n):
    c+=1
    b+=ls[an]
    if b>x:
        break
print(c)

n,x=map(int,input().split())
ls=list(map(int,input().split()))
c = 1
b = 0
for an in range(n):
    b+=ls[an]
    if b>x:
        break
    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())
arr=list(map(int,input().split()))
d=0
ans=1
for a in arr:
  d+=arr
  if d <= x:
    ans+=1
print(ans)

n,x=map(int,input().split())
arr=list(map(int,input().split()))
d=0
ans=1
for a in arr:
  d+=a
  if d <= 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=(int(x) for x in input().split())
L = input().split()
L = [int(x) for x in L]
count = 0
D = 0
for i in L:
  D = D + i
  if D <= X:
    count = count + 1
  print(D)
print(count+1)

N,X=(int(x) for x in input().split())
L = input().split()
L = [int(x) for x in L]
count = 0
D = 0
for i in L:
  D = D + i
  if D <= X:
    count = count + 1
#  print(D)
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 = [int(x) for x in input().split()]

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

if D[-1] <= X:
    ans = N+1

print(ans)

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

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


n, x = map(int, input().split())
l = list(map(int, input().split()))
d = 0
i = 1
while True:
    if d > x:
        print(i - 1)
        break
    if i == n + 1:
        print(i)
        break
    i += 1
    d += l[i-2]


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()))
mem=1; ans=0
for i in L:
    mem+=i
    if mem<=X: ans+=1
print(ans)

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


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


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



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


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

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

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

print(cnt)

n, x = map(int, input().split())
l = list(map(int, input().split()))
cnt = 0
s = 0
for i in l:
    s += i
    if s <= x:
        cnt += 1
    else:
        break

print(cnt)

n , x = map(int, input().split())
l = list(map(int, input().split()))
tmp = [0] * (n + 1)
sum = 0
for i in range(n):
    sum += l[i]
    tmp[i + 1] = sum 

cnt = 0
for i in range(len(tmp)):
    if tmp[i] <= x:
        cnt += 1

print(cnt)

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):
import numpy as np

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

CS_L = np.cumsum(L).tolist()
ans = len([l for l in L if l <= x])
print(ans)

d, i = 0, 0
while d <= x:
    d += L[i]
    i += 1

print(i)

import numpy as np

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

CS_L = np.cumsum(L).tolist()
ans = len([l for l in CS_L if l <= x])
print(ans)

import numpy as np

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

CS_L = np.cumsum(L).tolist()
ans = len([l for l in CS_L if l <= x])
print(ans + 1)

Verdicts: Wrong Answer

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):
a,b=map(int, input().split())
list = input().split(' ')

s = 0
c = 0

for item in range(a):
    c += 1
    if (s + int(item)) <= b:
        s += int(item)
    else:
        break

print(c)

a,b=map(int, inout().split())
list = input().split(' ')

s = 0
c = !

for item in list:
    c += 1
    if (s + int(item)) <= b:
        s += int(item)
    else:
        break

print(c)

a,b=map(int, input().split())
list = input().split(' ')

s = 0
c = 1

for item in list:
    if (s + int(item)) <= b:
        c += 1
        s += int(item)
    else:
        break

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):
import itertools 
n,x = list(map(int,input().split()))
l = list(map(int,input().split()))
k = list(itertools.accumulate(l))
k.append(0)
k.sort()
s = 0
ii = 0

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

import itertools 
n,x = list(map(int,input().split()))
l = list(map(int,input().split()))
k = list(itertools.accumulate(l))
k.append(0)
k.sort()
ii = 0
for i in k:
    if(i<=x):
        ii+=1
        continue
    else:
        break
print(max(1,ii))

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(lambda a: int(a), input().split(" ")))
L = list(map(lambda b: int(b), input().split(" ")))

i = 1
s = 0
while(s <= X and i < len(L)):
  s += L[i]
  i += 1

print(i)

N, X = list(map(lambda a: int(a), input().split(" ")))
L = list(map(lambda b: int(b), input().split(" ")))

i = 0
s = 0
while(s <= X and i < len(L)):
  s += L[i]
  i += 1

if s <= X:
  i += 1

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

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

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

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

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

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

print(ans)

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

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

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

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

Verdicts: Wrong Answer

Wrong Answer

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 = [int(i) for i in input().split()]
s = 1
d = 0
while d <= x:
  for i in range(0,n):
    d = d + l[i]
    s += 1
print(s)

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


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

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

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


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,X=(int(i) for i in input().split())
L=[int(i) for i in input().split()]
for i in range(1,N+1):
    if sum(L[:i])>X:
        print(i)

N,X=(int(i) for i in input().split())
L=[int(i) for i in input().split()]
for i in range(1,N+1):
    if sum(L[:i])>X:
        print(i)
        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):

url = "https://atcoder.jp//contests/abc130/tasks/abc130_b"

def main():
    n,x = list(map(int, input().split()))
    lis = list(map(int, input().split()))
    lis.insert(0, 0)
    count = 0
    pos = 0
    for l in lis:
        pos += l
        count += 1
        if pos > x:
            print(count)
            exit()
    print(count)

if __name__ == '__main__':
    main()



url = "https://atcoder.jp//contests/abc130/tasks/abc130_b"

def main():
    n,x = list(map(int, input().split()))
    lis = list(map(int, input().split()))
    lis.insert(0, 0)
    count = 0
    pos = 0
    for l in lis:
        pos += l
        count += 1
        if pos > x:
            print(count-1)
            exit()
    print(count)

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 range(N)]

D =[]
D[0]=0

for i in range(N):
  x += L[i]
  D.append(x)
  
  
print(D)

import bisect
n,k = map(int,input().split())
l = list(map(int,input().split()))
x=[0]
num = 0
for i in range(n):
  num += l[i]
  x.append(num)


ans = bisect.bisect_right(x,k)
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())
arr = list(map(int,input().split()))
sumarr = np.cumsum(arr)
print(len(sumarr[sumarr<=X])+1)


import numpy as np
N,X = map(int,input().split())
sumarr = np.cumsum(list(map(int,input().split())))
print(len(sumarr[sumarr<=X])+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=list(map(int,open().split()))
i=list(map(int,open().split()))
listD=[0]
d=0

for s in i:
	d=d+s
	if d <= X:
		listD.append(d)
        
print(len(listD))

N,X=list(map(int,input().split()))
i=list(map(int,input().split()))
d=1
a=0
for s in i:
	a+=s
	if a<=X:
		d+=1        
print(d)

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

cnt = 0
ans = [0]

for i in l:
    cnt += i
    if cnt <= x:
        ans.append(cnt)
print(ans)

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

cnt = 0
ans = [0]

for i in l:
    cnt += i
    if cnt <= x:
        ans.append(cnt)
print(len(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()))
countBound = 0
coordinate = 0


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

countBound += 1
print(countBound)


def bound(n, x, l):
    coordinate = 0
    for i in range(n):
        coordinate += l[i]
        if x < coordinate:
            return i
        else:
            continue
    return n


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

print(ans)


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

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

print(ans)


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

print(ans)


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

print(ans)


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):
N, X = map(int, input().split())

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

position  = 0
count = 0

for i in range(N):
    position += int(input())
    if position <+ X:
        count += 1

print(count)


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

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

position = 0
count = 0

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

print(count)


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

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

position = 0
count = 1

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

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

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

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

print(a)




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

for i in l:
    
    if su>x:
        
        break
    su+=i
    if su<=x:
        a+=1
   

print(a)




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 = [0] + [int(i) for i in input().split()]

c = 0

for i in range(len(l)):
    if sum(L[:i+1]) <= x:
        c += 1
print(c)

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

c = 0

for i in range(len(l)):
    if sum(l[:i+1]) <= x:
        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):
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    n,x=INTM()
    l=LIST()
    ct=0
    temp=0
    for i in range(n):
        temp+=l[i]
        if temp<=x:
            ct+=1
        else:
            break
    print(ct)
if __name__ == '__main__':
    do()

INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    n,x=INTM()
    l=LIST()
    ct=1
    temp=0
    for i in range(n):
        temp+=l[i]
        if temp<=x:
            ct+=1
        else:
            break
    print(ct)
if __name__ == '__main__':
    do()

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

RES = []
ichi = 0
cnt = 1

for i in LIST:
    if ichi <= X:
        cnt = cnt + 1
        ichi = ichi + i

print(cnt)

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

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

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

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


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

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

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

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

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

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

Verdicts: Runtime Error

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):
def main15():
    data = input().split()
    num = []
    for i in range(2):
        num.append(int(data[i]))
    data2 = input().split()
    num2 = []
    for i in range(num[0]):
        num2.append(int(data2[i]))
    length = 0
    result = 1
    for i in range(num[0]):
        length = length + num[2]
        if length > num[1]:
            break
        else:
            result = result + 1
    print(result)

if __name__ == "__main__":
    main15()

def main15():
    data = input().split()
    num = []
    for i in range(2):
        num.append(int(data[i]))
    data2 = input().split()
    num2 = []
    for i in range(num[0]):
        num2.append(int(data2[i]))
    length = 0
    result = 1
    for i in range(num[0]):
        length = length + num2[i]
        if length > num[1]:
            break
        else:
            result = result + 1
    print(result)

if __name__ == "__main__":
    main15()

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 = input().split()[1]

ls = [int(n) for n in input().split()]

for index in range(len(ls)):
	list = ls[0:index]
	if sum(list) > x:
		print(index)
		break
	elif sum(list) == x:
		print(index + 1)
		break

x = int(input().split()[1])

ls = [int(n) for n in input().split()]

for index in range(len(ls)):
	list = ls[0:index]
	if sum(list) > x:
		print(index)
		break
	elif sum(list) == x:
		print(index + 1)
		break

	if index == len(ls) - 1:
		print(len(ls) + 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] * (N+1)
D[0] = 0
k=0
for i in range(N):
  if D[i] <= X:
    D[i+1] = D[i] + L[i]
    k += 1
if D[N] <= X:
  k += 1
print(k)    

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

count = 1
d = 0
for i in range(N):
        d_a = d + int(l_list[i])
        d = d_a
        if d_a <= X:
                count +=1
        else:
                print(count)

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

count = 1
d = 0
for i in range(N):
        d_a = d + int(l_list[i])
        d = d_a
        if d_a <= X:
                count +=1
        else:
                print(count)
            　　break

d_list = [0]
N,X = input().split(" ")
l_list = input().split(" ")

for i in range(int(len(l_list))):
    num = int(d_list[i]) + int(l_list[i])
    d_list.append(num)
    print(d_list)

for i in range(int(len(d_list)-1)):
    if d_list[i]<=int(X)< d_list[i+1]:
        print(i+1)

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

count = 1
d = 0
for i in range(N):
        da = d + int(l_list[i])
        d = da
        if da <= X:
                count +=1
        else:

                print(count)
                break
        if count == int(N) + 1:
                print(count)

Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Accepted