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:
# -*- coding: utf-8 -*-
import sys

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

result = 0
for i in range(N):
  result += inputs[i]
  if X < result:
    break

print(i + 1)

Submission status: Wrong Answer

Solution code:
n, x = map(int,input().split())
a =  list(map(int,input().split()))
total = 0
for i, it in enumerate(a):
    total += it
    if total > x:
        break
        
print(i+1)

Submission status: Wrong Answer

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

cnt = 0
D = 0
while D <= X:
    if cnt >= len(L)-1:
        cnt += 1
        break
    D += L[cnt]
    cnt += 1
    

print(cnt)

Submission status: Wrong Answer

Solution code:
n, x = list(map(int, input().split()))
llist = list(map(int, input().split()))
kai = 0
tsumu = 0
while tsumu <= x and llist != [] :
    kai += 1
    tsumu += llist.pop(0)
else :
    if llist == [] :
        kai += 1
print(kai)

Submission status: Wrong Answer

Solution code:
str = input()
N = int(str.split()[0])
X = int(str.split()[1])

str = input()
L = []
for i in range(N) :
	L.append(int(str.split()[i]))

D = 0
i = 0
while(D <= X) :
	D = D + L[i]
	i = i + 1
	if (i == len(L)) :
		break


print(i)

Submission status: Wrong Answer

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

D = 0
for i, L in enumerate(L_list):
  D += int(L)
  if D > int(X):
    break

print(i + 1)

Submission status: Wrong Answer

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

sumL, countL = 0, 0
for l in L:
    if sumL <= X:
        countL += 1
    sumL += l

print(countL)

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()))
d=0

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
N,X =[int(i) for i in input().split()]
L = [int(i) for i in input().split()]
D = 0
for i in range(N):
  if D > X:
    print(i)
    break
  D += L[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 = 1
for i, Li in enumerate(Ls):
    if d <= X:
        res += 1
        break
    d += Li
print(res)

Submission status: Wrong Answer

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

pointList = []
for i in range(len(L)):
  if i != 0:
    x = pointList[i-1]+L[i-1]
    pointList.append(x)
  else:
    pointList.append(0)
    
num = 0
    
for i in range(len(pointList)):
  if pointList[i]<=X:
    num += 1

print(num)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

def main():
    N, X = map(int, input().split())
    L = list(map(int, input().split()))
    L.insert(0, -1)
    L.insert(0, -1)

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


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

count= 0
sumList=[]
sumList.append(0)

for i in range(N):
  sumList.append(sum(L[0:i+1]))
  if(sum(L[0:i+1]) == X):break

print(len(sumList))

Submission status: Wrong Answer

Solution code:
a=list(map(int,input().split()))
n=0
zahyo=0
i=0
hane=list(map(int,input().split()))
while zahyo<=a[1]:
    if i<a[0]:
        n=n+1
        zahyo=zahyo+hane[i]
        i=i+1
    else:
        break
print(n)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# AC

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

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

Submission status: Wrong Answer

Solution code:
a=input().split()
N,X=int(a[0]),int(a[1])
b=input().split()
l=[None]*N
x=0
c=0
for i in range(N):
    if x>X:
        break
    x+=int(b[i])
    c+=1
print(c)

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
for i, l in enumerate(Ls):
  D = D + l
  if D > X:
    print(i+1)
    break

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

ans = 0
bound = 1

for i in l_list:
    ans += i
    if ans >= x:
        if ans == x:
            bound += 1
        print(bound)
        break

    bound += 1

Submission status: Wrong Answer

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

sum = 0
count = 0
while sum <= x:
    sum += L[count]
    count += 1
    if count == n:
        break

print(count)

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 = 1
for i, Li in enumerate(Ls):
    if d <= X:
        res += 1
        continue
    d += Li
print(res)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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:
        ans -= 1
        break
    ans += 1
    d += int(i)

print(ans+1)

Submission status: Wrong Answer

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

jump = 0
for i in range(N+1):
    if jump <= X:
        ans += 1
    jump += L[i-1]

print (ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import sys
inpt = sys.stdin.readline
 
def count(N, X, Ls):
  curr = 0
  for i in range(N):
    l_im1 = Ls[i]
    curr += l_im1
    if curr > X:
      return i+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:
str = input()
N = int(str.split()[0])
X = int(str.split()[1])

str = input()
L = []
for i in range(N) :
	L.append(int(str.split()[i]))

D = 0
i = 0
while(D <= X) :
	D = D + L[i]
	i = i + 1
	if (i == len(L) - 1) :
		break


print(i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, X = map(int, input().split())
L = list(map(int, input().split()))
cnt = 0
for l in L:
    if l <= X:
        cnt += 1
print(cnt)

Submission status: Wrong Answer

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

D = 0
count = 1

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

print(count)

Submission status: Wrong Answer

Solution code:
X = input().split()
Y = input().split()

D = 0
Da = 0

for i in range(int(X[0])):
    D = Da + int(Y[i])
    if D > int(X[1]):
        break
    Da = D

print(i+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in l:
	if i + l_cnt <= x:
		cnt += 1
		l_cnt += i

print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

d = 0

cnt = 0

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

print(cnt)

Submission status: Wrong Answer

Solution code:
def acinput():
    return list(map(int,input().split(" ")))


N,X=acinput()
L=acinput()

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

Submission status: Wrong Answer

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

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


now = 0
i = 0
ans = 0
while True:
    if i == N:
        ans -= 1
        break
    if now > X:
        break
    now += L[i]
    i += 1
    ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(input())
def S(): return list(input())
n,x=IL()
L=IL()
ans=1
d=0
for i in range(n):
    d+=L[i]
    if d<=x:
        ans+=1
    else:
        print(ans)
        break

Submission status: Wrong Answer

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

L = inb.split()

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

Submission status: Wrong Answer

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

sum_l = 0
if sum(Ls) < x:
    print(n+1)
else:
    for idx in range(n):
        sum_l += Ls[idx]
        if sum_l > x:
            print(idx+1)
            break

Submission status: Wrong Answer

Solution code:
# W, H, x, y = [int(i) for i in input().split()]
N, X = [int(i) for i in input().split()]
L = [int(i) for i in input().split()]
D = 0
count = 0
answer = 1

while D <= X:
  if count + 1 > len(L):
    count -= 1
    break
  D += L[count]
  count += 1
  answer += 1

print(answer - 1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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] * N
C = 0
for i in range(N-1):
	D[i+1] = D[i]+L[i]

for i in range(N):
	if D[i] <= X:
		C += 1

print(C)

Submission status: Wrong Answer

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

l = [int(i) for i in input().split(" ")]
l.insert(0, 0)

d = 0
count = 0
for i in l:
  if (d > x) :
    break
  
  if (i == 0) :
    continue
  else :
    d += i
    
  count = count + 1
  
print(count)

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

Submission status: Wrong Answer

Solution code:
n,x = map(int,input().split())
l = list(map(int,input().split()))
#print(len(l))
a = len(l)
d = 0
i = 0
while(i<a):
    if d <= x:
        d += l[i]
        i += 1
    else:
        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
    d += Li
if X == d:
    res += 1
print(res)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

cnt = 0
di = 0
if sum(l) <= x:
  print(n+1)
else:
  while di <= x:
    cnt += 1
    di += l[cnt-1]
    print(cnt)

Submission status: Wrong Answer

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

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

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]
  if sum>X:
    print(i+1)
    break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,X=map(int,input().split())
ps = [int(i) for i in input().split()]
resum=0
count=0
for i in ps:
    resum += i
    count += 1
    if resum>X:
        break
print(count)
exit(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from copy import deepcopy
import sys
from itertools import accumulate
N,X = map(int,input().split())
Llist = list(map(int,input().split()))

ruiseki = accumulate(Llist)
for i,r in enumerate(ruiseki,1):
    if r > X:
        print(i)
        sys.exit()

print(i)

Submission status: Wrong Answer

Solution code:
N,X = map(int,input().split(" "))
L = input().split(" ")
L = [int(i) for i in L]
cd = 0
list = [cd]
for i in range(N):
    cd = cd + L[i]
    list.append(cd)
#print(list)
ans_list = []
for i in range(N):
    if (list[i] <= X):
        ans_list.append(list[i])
#print(ans_list)
if len(ans_list) > N+1:
    print(N+1)
else:
    print(len(ans_list))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

for i in range(1,n):
    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:
def LI(): return list(map(int, input().split()))

n, x = LI()
l = LI()

s = [sum(l[0:i]) for i in range(n)]
count = sum([x >= i for i in s])

print(count)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
N,X = map(int,input().split(" "))
L_l = map(int,input().split(" "))
pos = 0
for i,L in enumerate(L_l):
    pos += L
    if(pos>X):
        print(i+1)
        exit(0)

print(i+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

d = 0
if sum(L) <= X:
    print(len(L))
    exit()

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

Submission status: Wrong Answer

Solution code:
#W,H,x,y=(int(x) for x in input().split())

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

Submission status: Wrong Answer

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

    def count_bound(self):
        d = 0
        counter = 0

        for l in self.L:
            if d <= self.X:
                counter += 1
                d = d + l
            else:
                break

        print(counter)


bounding = Bounding()
bounding.count_bound()

Submission status: Wrong Answer

Solution code:
n, x = list(map(int, input().split()))
L = list(map(int, input().split()))
length = 0
i = 0
while x >= length and n > i:
    length += L[i]
    i += 1
print(i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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


now = 0
i = 0
ans = 0
while True:
    if now > X or i == N:
        break
    now += L[i]
    i += 1
    ans += 1

print(ans)

Submission status: Wrong Answer

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

tmp = 0
count = 0
for i in range(n):
    tmp += L[i]
    count += 1
    if x < tmp:
        print(count)
        break
    elif i == n-1:
        print(count)

Submission status: Wrong Answer

Solution code:
import sys
inpt = sys.stdin.readline

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

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

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] * N
C = 0
for i in range(N-1):
	D[i+1] = D[i]+L[i]

for i in range(N):
	if D[i] < X:
		C += 1

print(C)

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

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
    for i, l in enumerate(li):
        if sum > x:
            print(i)

        sum += l

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

Submission status: Wrong Answer

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

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

print(len(ll))

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]
    else:
        print(count)
        break

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:
        break

print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print (cnt)

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.append(d[-1] + L[-1])

ans = sum([1 if dv <= X else 0 for dv in d])

print(ans)

Submission status: Wrong Answer

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

print(i+1)

Submission status: Wrong Answer

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

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

count = 0
ans = 0
for i in boundlist:
    if count <= X:
        count += i
        ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
def resolve():
    (N, X) = list(map(int, input().split(" ")))
    Ls = list(map(int, input().split(" ")))
    cur = 0
    cnt = 0
    for l in Ls:
        if cur > X:
            print(cnt)
            break
        cnt += 1
        cur += l
    else:
        print(cnt)

    

if '__main__' == __name__:
    resolve()

Submission status: Wrong Answer

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

ans_count = 1
ans = 0
for i in range(len(L)):
    if ans + L[i] <= X:
        ans = ans + L[i]
        ans_count = ans_count+1
        
print(ans_count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

d = 0
if d > X:
    print(0)
    exit()
for idx, l in enumerate(Ls):
    if d > X:
        print(idx)
        exit()
    d += l

print(len(Ls))

Submission status: Wrong Answer

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

sum = 1
now = 0

for i in range(len(l)):
    now += l[i]
    if now <= x:
        sum += 1
    else:
        print(sum)
        break

Submission status: Wrong Answer

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

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):
    if(length_sum + l[i] <= line_length):
        bound += 1
    else:
        print(bound)
        exit()
    length_sum += l[i]

Submission status: Wrong Answer

Solution code:
def main():
    N, X = map(int, input().split())
    lst = list(map(int, input().split()))
    cnt = 0
    s = 0
    for i in range(N):
        if s <= X:
            cnt += 1
        s += lst[i]
    print(cnt)
main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

cnt = 0
d = 0

while(x >= d):
  d += l[cnt]
  if cnt + 1 == n:
    break
  cnt += 1

print(cnt)

Submission status: Wrong Answer

Solution code:
def B(n, x, a):
    i = 0
    sum_n = 0
    while i < n and sum_n <= x:
        sum_n += a[i]
        i += 1

    return i


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

    print(B(n, x, a))

Submission status: Wrong Answer

Solution code:
n,x = map(int,input().split())
a= list(map(int,input().split()))
s= 0
c=0
for v in a:
    c+=1
    s+=v
    if s>x:
        break
print(c)

Submission status: Wrong Answer

Solution code:
i=[int(i) for i in input().split()]
n=i[0]
x=i[1]
L=[int(i) for i in input().split()]

sum=0
res=0
for step in range(n):
    if sum<=x:
        res+=1
        sum+=L[step]
    else:
        break

print(res)

Submission status: Wrong Answer

Solution code:
def main():
    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:
            print(i+1)
            return

    print(i)
    return

if __name__ == '__main__':
    main()

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

count = 0
zahyo = 0

for i in range(N):
    if zahyo <= X:
        count += 1
    zahyo = zahyo + li_L[i]

print(count)

Submission status: Wrong Answer

Solution code:
N, X = map(int,input().split()) # 複数の数字を変数に格納
List = list(map(int,input().split())) # 複数の数字をリストに格納

count = 1
point = 0

while point <= X and count <= N:
    point += List[count-1]
    count += 1

print(count)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

print(count)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

a = 1

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

print(a)

Submission status: Wrong Answer

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

ans = 0
point = 0

for i in range(len(l_li)):
    if i == 0:
        ans += 1
    else:
        point = point + l_li[i-1]
        if point <= x:
            ans += 1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

N,X=map(int,input().split())
li=list(input().split())
li=[int(s) for s in li]
poti=0

cut=0
for i in range(N):
    #print(poti,X)
    if poti>X:
        break
        
    else:
        poti+=li[i]
        cut+=1
        
        
print(cut)

Submission status: Wrong Answer

Solution code:

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

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

Submission status: Wrong Answer

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

jump = 0
for i in range(N):
    if jump <= X:
        ans += 1
    jump += L[i]

print (ans)

Submission status: Wrong Answer

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

print(cnt)

Submission status: Wrong Answer

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

count=0
ans=1

for i in list:
  count += i
  if count > X:
    print(ans)
    exit()
  ans += 1