Problem:


Score : 200 points

Problem Statement

A ball will bounce along a number line, making N + 1 bounces. It will make the first bounce at coordinate D_1 = 0, and the i-th bounce (2 \leq i \leq N+1) at coordinate D_i = D_{i-1} + L_{i-1}.

How many times will the ball make a bounce where the coordinate is at most X?

Constraints

1 \leq N \leq 100

1 \leq L_i \leq 100

1 \leq X \leq 10000

All values in input are integers.

Input

Input is given from Standard Input in the following format:

N X
L_1 L_2 ... L_{N-1} L_N

Output

Print the number of times the ball will make a bounce where the coordinate is at most X.

Sample Input 1

3 6
3 4 5

Sample Output 1

2

The ball will make a bounce at the coordinates 0, 3, 7 and 12, among which two are less than or equal to 6.

Sample Input 2

4 9
3 3 3 3

Sample Output 2

4

The ball will make a bounce at the coordinates 0, 3, 6, 9 and 12, among which four are less than or equal to 9.



Sample input:
3 6
3 4 5


Sample output:
2

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n, x = (int(i) for i in input().split())
l = [int(i) for i in input().split()]
count = 0
current = 0
while current <= x and  count < n:
    current += l[count]
    count += 1
print(count)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

l = [int(s) for s in input().split()]
d = 0
i = 1
d = [0] * (n+1)
count = 0
if n == 1 and x >= l[0]:
    print(1)
elif n == 1 and x < l[0] :
    print(0)
else:

    while True:
        
        
        d[i] = d[i-1] + l[i-1]
        count += 1
        
        if d[i] > x:
            break
        
        i += 1
        if i > n:
            print(count)
            exit()

    print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
import numpy as np

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

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

x = np.zeros(N+1)

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

print(N)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

def count_bound(L):
	s=0
	count = 0
	for l in L:
		if(s<=X):
			count+=1
		s+=l
	return count

print(count_bound(L))

Submission status: Wrong Answer

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

dist = 0

for (i, v) in enumerate(L):
  dist += v
  if dist > x:
    break
    
print(i+1)

Submission status: Wrong Answer

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

cnt = 0
di = 0

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

Submission status: Wrong Answer

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

if n == 0:
    print(0)
else:

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

    if x == 0:
        print(0)


    else:

        sum = 0
        v=0
        for i, l in enumerate(li):
            v = i
            if sum > x:
                break

            sum += l

        if v+1 == len(li):
            print(v+1)
        else:
            print(v)

Submission status: Wrong Answer

Solution code:
#ABC130B-Bounding.py

import sys
from functools import lru_cache

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

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



if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from collections import deque

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

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

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

    print(n-len(l))

Submission status: Wrong Answer

Solution code:
import sys
import numpy as np

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

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

x = np.zeros(N+1)

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

print(N)

Submission status: Wrong Answer

Solution code:
n,x=map(int,input().split())
l=list(map(int,input().split()))
t=0
c=0
e=0
for i in range(n):
  t+=l[i]
  c+=1
  if t>x:
    e=c
print(e if e!=0 else len(l))

Submission status: Wrong Answer

Solution code:
import sys

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

Submission status: Wrong Answer

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

pos = 0

for i in range(len(l)):
    pos = pos + l[i]

    if pos > X:
        print(i+1)
        break

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import sys

input = sys.stdin.readline

cnt = 0

def main():
    N, X = map(int, input().split())
    L = [int(e) for e in input().split()]

    def rec(i, d):
        global cnt
        if d > X or i >= N:
            return
        cnt += 1
        return rec(i+1, d + L[i])

    rec(0, 0)
    print(cnt)


main()

Submission status: Wrong Answer

Solution code:
N, X = [int(x) for x in input().split(' ')]
Ls = [int(x) for x in input().split(' ')]

D = 0
i = 1
for l in Ls:
  D = D + l
  if D <= X:
    i = i + 1
  else:
    print(i)
    break

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

cnt = 0
total = 0
i = 0

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

print(cnt)

Submission status: Wrong Answer

Solution code:
def solve():
    n, x = map(int, input().split())
    L = list(map(int, input().split()))
    t = 0
    ans = 0
    for i in range(n):
        if t + L[i] > x:
            ans = i
            break
        t += L[i]
    else:
        ans = i
    return ans + 1
print(solve())

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
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)
    break
  elif cnt == n+1:
    print(cnt)
    break
  else:
    pass

Submission status: Wrong Answer

Solution code:
#ABC130B-Bounding.py

import sys
from functools import lru_cache

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

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



if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
N,X = map(int,input().split())
L = [int(x) for x in input().split()]
L_cnt = 0
cnt = 1
for i in range(1,N):
  L_cnt += L[i]
  if L_cnt <= X:
    cnt += 1
  else:
    continue
print(cnt)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

c = 0
d = 0

while d <= x:
  if c >= len(ls):
    break
  c += 1
  d += ls[c-1]

print(c)

Submission status: Wrong Answer

Solution code:
N, X = [int(s) for s in input().split()]
Ls = [int(s) for s in input().split()]
d, ans = 0, 0
for l in Ls:
    if d <= X:
        ans += 1 
    d += l
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if n == 0:
    print(0)
else:

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

    if x == 0:
        print(1)


    else:

        sum = 0
        v=0
        for i, l in enumerate(li):
            v = i
            if sum > x:
                break

            sum += l

        if v+1 == len(li):
            print(v+1)
        else:
            print(v)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import itertools 
n,x = list(map(int,input().split()))
l = list(map(int,input().split()))
k = list(itertools.accumulate(l))
k.sort()
s = 0
ii = 0
for i in k:
    if(i>x):
        s = ii
        break
    ii+=1
print(s+1)

Submission status: Wrong Answer

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

L = input().split()
pos = 0
ans = 1
for i in range(N):
  print(i)
  pos += int(L[i])
  if(pos <= X):
    ans +=1
  else:
    break
  
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

d=0
cnt=0
for i in range(n):
    if d>x :
        print(cnt) 
        sys.exit()   
    else:
        d+=l[i]
        cnt+=1
print(n+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

cnt = 0
total = 0
i = 0

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


print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#N回跳ねるボール　1≤X≤10000　Xは領域
N, X = map(int, input().split())
#Lははねた距離
length = list(map(int, input().split()))

#トータルの距離
count_total = 0
#最初の位置
now = 0
  
for count in range(N):
  #もし領域よりも小さければもう一回跳ねる
	while now <= X:
		now = now + length[count]
		count_total = count_total + 1
  
print(count_total)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

ans = 0
cnt = 1

for i in nums:
    if ans + i <= X:
        ans = ans + i
        cnt += 1

print(cnt)

Submission status: Wrong Answer

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

if n == 0:
    print(0)

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

if x == 0:
    print(1)


else:

    sum = 0
    v=0
    for i, l in enumerate(li):
        v = i
        if sum > x:
            break

        sum += l

    if v+1 == len(li):
        print(v+1)
    else:
        print(v)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
def main():
    N,X = map(int,input().split())
    L=[int(i) for i in input().split()]
    Ls = 0
    count = 1
    for i in range(N):
        Ls = Ls+L[i]
        print(Ls)
        if Ls<=X:
            count+=1
    print(count)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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

print(i)

Submission status: Wrong Answer

Solution code:
n,x = map(int,input().split())
blist = input().split()
i = 0
b = 0
while i < n:
  b += int(blist[i])
  if b > x:
    print(i + 1)
    break
  else:
    i = i + 1

Submission status: Wrong Answer

Solution code:
bound_num, line_length = map(int, input().split())
l = list(map(int, input().split()))

bound = 1
length_sum = 0
for i in range(bound_num + 1):
    if(i == bound_num):
        bound += 1
        print(bound)
        exit()
    if(length_sum + l[i] <= line_length):
        bound += 1
    else:
        print(bound)
        exit()
    length_sum += l[i]

Submission status: Wrong Answer

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

#N, X = [4,9]
#Ls = [3,3,3,3]

count = 0
position = 0
for i in range(N):
    if X<position:
        break
    else:
        count += 1
        position += Ls[i]

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,X = map(int,input().split())
num = 0
count = 0
listA=list(map(int,input().split()))
    #listA<-[1,2,2,3,1]
    #ここに逐次処理を書けばいいと思う。

for i in range(N+1):
    if num<=X and i<N:
        num = num+listA[i]
        count=count+1
    else:
        break
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 0
num = 0

for i in range(l):
	if num <= X:
		ans += 1
		num += int(S[i])

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

count = 0
now = 0
for i in L:
    if now > X:
        break
    now += i
    count += 1

print(count)

Submission status: Wrong Answer

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

cnt = 1
d = 0

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

D = 0
for i in range(n):
#    print(D)
    if D > x:
        print(i)
        exit()
    D += l[i]

print(i+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, X = [int(s) for s in input().split()]
Ls = [int(s) for s in input().split()]
d, ans = 0, 0
for l in Ls:
    print(l, d)
    if d <= X:
        ans += 1 
    d += l
print(ans)

Submission status: Wrong Answer

Solution code:
def solve():
    n, x = map(int, input().split())
    L = list(map(int, input().split()))
    t = 0
    ans = 0
    for i in range(n):
        if t + L[i] > x:
            ans = i
            break
        t += L[i]
    return ans + 1
print(solve())

Submission status: Wrong Answer

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

else:
    print(ans)

Submission status: Wrong Answer

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


main()

Submission status: Wrong Answer

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


def solve(N: int, X: int, L: "List[int]"):
    x = 0
    for i,l in enumerate(L):
        x += l
        if x > X:
            print(i+1)
            return



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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

cnt = 0
di = 0

for i, li in enumerate(l):
  di += l[i]
  if di > x:
    break
    
print(i+1)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
#n = int(input()) 
n,x = (int(i) for i in input().split())
l= [int(i) for i in input().split()]

d=0
i=0
while d <=x:
    if i >=n:
        break
    else:
        d=d+l[i]
        i+=1
print(i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from collections import deque

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

l = deque(list(map(int,input().split())))
count = 0
while count <= x:
    count += l.popleft()
    if len(l) == 0:
        break

print(n-len(l))

Submission status: Wrong Answer

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

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

print(i+1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n, x = map(int, input().split())
l = list(map(int, input().split()))
p = 0
i = 0
while p <= x and l:
    p += l.pop(0)
    i += 1
print(i)

Submission status: Wrong Answer

Solution code:

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

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

    result = 1
    D = 0

    for i in L:


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


    return result

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

Submission status: Wrong Answer

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

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

print(str(i+1))

Submission status: Wrong Answer

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

LLL = list(map(int, input().split()))  # 長さN

d = [0]
for i in range(len(LLL)):
    d.append(d[-1]+LLL[i])

for i in range(1, len(d)):
    if d[i] > X:
        print(i)
        exit()

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

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

bound_times = 0
now_point = 0

for i in L:
    if now_point > X:
        break
    now_point += i
    bound_times += 1
    
if now_point < X:
    bound_times += 1
    
print(bound_times)

Submission status: Wrong Answer

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

now = 0
a = 0
for i in range(N):
    if now <= X:
        now += L[i]
        a += 1
    else:
        break

print(a)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

D = [0] * len(L)
cnt = 1 if D[0] <= X else 0
for i in range(1, N):
    D[i] = D[i - 1] + L[i - 1]
    cnt += 1 if D[i]<=X else 0

print(cnt)

Submission status: Wrong Answer

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

# List = list([map(int, input().split())] for _ in range(N))
# List = [list(map(int, input().split())) for _ in range(N)]
List = list(map(int, input().split()))
# print(List)

ans = 1
sum_x = 0
for i in range(N):
    if(sum_x + List[i] <= X):
        # print(List[i])
        sum_x += List[i]
        ans += 1
# print(sum_x)
print(ans)

Submission status: Wrong Answer

Solution code:
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

Submission status: Wrong Answer

Solution code:
n,x = (int(i) for i in input().split())  
l = [int(i) for i in input().split()] 
d = 0
i=0
while d <= x:
    try:
        d+=l[i]
    except:
        break
    i+=1

print(i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

d=0
cnt=0
for i in range(n):
    if d>x :
        print(cnt) 
        sys.exit()   
    else:
        d+=l[i]
        cnt+=1
print(n)

Submission status: Wrong Answer

Solution code:
#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)

Submission status: Wrong Answer

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

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

if x == 0:
    print(1)
else:

    sum = 0
    v=0
    for i, l in enumerate(li):
        v = i
        if sum > x:
            break

        sum += l

    if v+1 == len(li):
        print(v+1)
    else:
        print(v)

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

d_i = 0
ans = 0
for l_i_val in l_i:
    if d_i <= x:
        ans += 1
    else:
        break

    d_i += l_i_val

print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
N, X = map(int, input().split())
# スペース区切りの整数の入力
L = input().split()
answer = 0
sum = 0
for n in range(N):
  if sum <= X:
    sum += int(L[n])
    answer += 1
print(answer)

Submission status: Wrong Answer

Solution code:
a=list(map(int, input().split()))
b=list(map(int, input().split()))
n=a[0]
c=[0]*(n+1)

for i in range(1,n+1):
    c[i]=c[i-1]+b[i-1]
    
cnt=0

for i in range (n):
    if(c[i]<=a[1]):
        cnt=cnt+1
        
print(cnt)

Submission status: Wrong Answer

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

kaisuu=0
kyori=0

for i in range(len(Ls)):
  kyori=kyori+Ls[i]
  kaisuu=kaisuu+1
  if kyori>X or kaisuu==N+1:
    break

print(kaisuu)

Submission status: Wrong Answer

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

# List = list([map(int, input().split())] for _ in range(N))
# List = [list(map(int, input().split())) for _ in range(N)]
List = list(map(int, input().split()))
print(List)

ans = 1
sum_x = 0
for i in range(N):
    if(sum_x + List[i] <= X):
        # print(List[i])
        sum_x += List[i]
        ans += 1
# print(sum_x)
print(ans)

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

Solution code:
a = list(map(int, input().split()))
L = list(map(int, input().split()))
d = 0
ans = 0
while d<=a[1] and ans<a[0]:
    d += L[ans]
    ans += 1
if ans==a[0]:
    ans += 1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

def input():
    return sys.stdin.readline().rstrip()

if __name__ == "__main__":
    n, x = map(int, input().split())
    llist = list(map(int, input().split()))
    llist.insert(0, 0)

    res = 0
    sum = 0
    for l in llist:
        if (sum + l) <= x:
            res += 1
            sum += l
    
    print(res)

Submission status: Wrong Answer

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

sum = 0
cnt = 1
for i in lst:
  sum += i
  if (sum < X):
    cnt += 1
  else:
    break
    
print(cnt)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

print(count)