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

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

Submission status: Accepted

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


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

    cnt = 1
    tmp = 0
    f = False
    for i in l:
        tmp += i
        if tmp > x:
            f = True
            break
        cnt += 1

    if f:
        print(cnt)
    else:
        print(n+1)

Submission status: Accepted

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

Submission status: Accepted

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

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

cnt = 1
dis = 0

for i in l:
    dis += i
    if dis > x:
        break
    cnt += 1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#abc130b

n,x=map(int,raw_input().split())
l=map(int,raw_input().split())
temp=0
c=1
for i in xrange(n):
 temp+=l[i]
 if temp<=x:
  c+=1
print c

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
import string
import itertools
import fractions
import heapq
import collections
import re
import array
import bisect
import sys
import random
import time
inf = 10**9


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

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

    print(c)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n, x = map(int, input().split())
l = list(map(int, input().split()))
ans = 0
d = []
d.append(0)
for i in range(n):
    d.append(d[i] + l[i])

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
line=input()
items=line.split(' ')
# print(items)
N=int(items[0])
X=int(items[1])
line2=input()
items2=line2.split(' ')
# print(items2)
l=[]
for i in range(N):
    l.append(int(items2[i]))
# print(l)
res=[0]
for i in range(2,N+2):
    d=res[i-2]+l[i-2]
    res.append(d)
# print(res)
c=0
for i in res:
    if i<=X:
        c+=1
print(c)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#B問題
N,X = map(int,input().split())
L = list(map(int,input().split()))
land = [0]
for i in range(N):
    land.append(land[-1]+L[i])
land.sort()
count = 0
for l in land:
    if l <= X:
        count+=1
        
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

ans = 1
pos = 0
for a in L:
  pos += a
  if pos > X:
    break
  ans += 1
  
print(ans)

Submission status: Accepted

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

d = 0
ans = 1
for a in L:
    d += a
    if d <= x:
        ans += 1
    else:
        break

print(ans)

Submission status: Accepted

Solution code:
import itertools
n,x = map(int,input().split())
L = [int(i) for i in input().split()]
cnt = 0
tmp = [0]
Sum = list(itertools.accumulate(L))
Sum = tmp + Sum

for i in range(len(Sum)):
    if Sum[i] > x:
        break
    else:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
s=list(map(int,input().split()))
t=list(map(int,input().split()))
a=0
b=1
for i in range(len(t)):
  if a+t[i]>s[1]:
    break
  else:
    a=a+t[i]
    b=b+1
print(b)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, x = map(int, input().split())  # 複数数値入力
l = list(map(int, input().split()))  # 複数数値入力(リスト格納)
ans =1
sum =0
for num in l:
    sum += num
    if sum>x:
        break
    else:
        ans+=1

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 1
d = 0

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
	N, X = map(int, input().split())
	L = list(map(int, input().split()))
	ans = 1
	h = 0
	for i in range(N):
		h += L[i]
		if h <= X:
			ans += 1
		else:
			break
	print(ans)

if __name__ == '__main__':
	main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 1
now = 0

for i in li:
    now += i
    if now <= x:
        ans += 1
    else:
        break

print(ans)

Submission status: Accepted

Solution code:
def solve(n, x, l):
    ans = 1
    d = 0
    for i in range(n):
        d += l[i]
        if d <= x:
            ans += 1
    return ans

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,x = map(int,input().split())
l = [int(i) for i in input().split()] 
ct = 0
num=0
for i,item in enumerate(l):
  ct+=1
  num+=item
  if(num > x):
  	break;
  elif(i==n-1):
  	ct+=1

print(ct)

Submission status: Accepted

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

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

Submission status: Accepted

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

print(count)

Submission status: Accepted

Solution code:

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

cnt = 1
d = 0

for _ in range(n):

    if d+l[cnt-1] <= x:
        d = d+l[cnt-1]
        cnt += 1
        # print(d)
    else:
        break

print(cnt)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, X = map(int, input().split())
*L, = map(int, input().split())
D = [0] * (N + 1)
for i in range(N):
	D[i + 1] = D[i] + L[i]
ans = len([j for j in D if j <= X])
print(ans)

Submission status: Accepted

Solution code:
import numpy as np

N, X = map(int, input().split())
L = list(map(int, input().split()))
# D = [np.array([])]
D = [0, 0]

for i in range(2, N + 2):
    D.append(D[i - 1] + L[i - 2])

D2 = np.array(D)    # numpy配列D2を作成

D3 = D2[D2 <= X]    # numpyを使ってX以下の要素を抽出

print('{}'.format(D3.size - 1))    # 回数を出力(D3[0]は不要なのでｰ1)

Submission status: Accepted

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

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

ruiseki = list(filter(lambda x: x <= X,ruiseki))
print(len(ruiseki))

Submission status: Accepted

Solution code:
import numpy as np

N, X = map(int, input().split())
L = list(map(int, input().split()))
# D = [np.array([])]
D = [0, 0]

for i in range(2, N + 2):
    D.append(D[i - 1] + L[i - 2])

D2 = np.array(D)    # numpy配列を作成

D3 = D2[D2 <= X]    # numpyを使ってX以下の要素を抽出

print('{}'.format(D3.size - 1))    # 回数を出力(D3[0]は不要なのでｰ1)

Submission status: Accepted

Solution code:
n,x = (int(i) for i in input().split())
z = [int(i) for i in input().split()]
p,a = 0,1
for i in z:
  p+=i
  if p>x: break
  else: a+=1
print(a)

Submission status: Accepted

Solution code:
import numpy as np

N, X = map(int, input().split())
L = list(map(int, input().split()))
# D = [np.array([])]
D = [0, 0]

for i in range(2, N + 2):
    D.append(D[i - 1] + L[i - 2])

D2 = np.array(D)

D3 = D2[D2 <= X]    # numpyを使ってX以下の要素を抽出

print('{}'.format(D3.size - 1))    # 回数を出力(D3[0]は不要なのでｰ1)

Submission status: Accepted

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

L_n = []
N, X = map(int, input().split())

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

Lsum = 0
cnt = 1
for i in range(N):
    Lsum += L_n[i]
    if Lsum <= X:
        cnt += 1


print(cnt)

Submission status: Accepted

Solution code:
import numpy as np

N, X = map(int, input().split())
L = list(map(int, input().split()))
# D = [np.array([])]
D = [0, 0]

for i in range(2, N + 2):
    D.append(D[i - 1] + L[i - 2])

D2 = np.array(D)

D3 = D2[D2 <= X]    # X以下の要素を抽出

print('{}'.format(D3.size - 1))    # 回数を出力

Submission status: Accepted

Solution code:
n,x =map(int,input().split())
lst = []
lst = list(map(int,input().split()))
pst = []
sum = 0
count = 0
for i in range(n):
  sum += lst[i]
  if sum < x or sum==x:
    count+=1
print(count+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,x,*l=map(int,open(0).read().split());print(sum(x>=sum(l[:i+1])for i in range(n))+1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
inp = input().split(" ")
n = int(inp[0])
x = int(inp[1])
l = input().split(" ")
d = 0
count = 1

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

Submission status: Accepted

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

#print(L)

p = 0
count = 1

for i in range(0,N):
    p += L[i]
    if p <= X:
        count += 1

print(count)

Submission status: Accepted

Solution code:
X,A = (int(x) for x in input().split())
L = list(map(int,input().split()))
cnt = 0
ans = 0
for i in range(X):
    ans += L[cnt]
    if(ans <= A):
        cnt += 1

print(cnt + 1)

Submission status: Accepted

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

ans = 1 #位置0も1にカウントするから
p = 0 #今のポジション
for i in range(N):
    p += L[i]
    if p <= X:
         ans += 1
    else:
        break

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

# nn = [0]
# for i in range(1, N):
#     nn.append(nn[i - 1] + nums[i])
    
for i in range(N):
    ans += nums[i]
    if ans <= X:
        cnt += 1
        

print(cnt)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(count_n)

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

ans = 1
p = 0
for e in L:
    p += e
    if p <= X:
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(i)

Submission status: Accepted

Solution code:
from itertools import accumulate, takewhile

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

D = list(takewhile(lambda a: a <= X, accumulate(L)))

print(len(D) + 1)

Submission status: Accepted

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

i = 1
D = 0

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

Submission status: Accepted

Solution code:
l = input().split()
n = int(l[0])
x = int(l[1])
l = input().split()
cnt = 1
d = 0

while(cnt -1 < len(l)):
    d = d + int(l[cnt-1])
    if(d<=x):
        cnt = cnt + 1
    else:
        break

if(cnt > n+1):
    cnt = n+1
print(cnt)

Submission status: Accepted

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

D = 0
ans = 1
for l in L:
    D += l
    if D <= X:
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
inp = list(map(int, input().split(" ")))
n = inp[0]
x = inp[1]

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

c = 1
cood = 0
for l in L:
  cood += l
  if cood <= x:
    c += 1
  else:
    break
print(c)

Submission status: Accepted

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

a = 0
ans = 0

if a <= X:
    ans += 1

for l in L:
    a += l
    if a <= X:
        ans += 1
        
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
def strToInt(strList):
    return [int(i) for i in strList]

N, X = input().split(' ')
line = strToInt(input().split(' '))

tmp = 0
i = 1
while i-1 < int(N):
    tmp += line[i-1]
    if int(X) < tmp:
        print(i)
        sys.exit()
    i=i+1
print(i)

Submission status: Accepted

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

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


print(b)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(ans+1)

Submission status: Accepted

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

d = 0
ans = 1
for l in L:
    d += l
    if d <= X:
        ans += 1
 
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(c)

Submission status: Accepted

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

print(i)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

D = 0
i = 1

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

Submission status: Accepted

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

count = 0
d = 0

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

print(count) if d>=x else print(count+1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

zahyo = 0
i = 0
while(zahyo <= x):
    
    zahyo = zahyo + li[i]
    
    if zahyo <= x:
        i = i+1
    if i == n:
        break

print(i+1)

Submission status: Accepted

Solution code:
from itertools import accumulate as acc
n,x=map(int,input().split())
L=[0]+[int(i) for i in input().split()]
#print(L)
D=list(acc(L))
cnt=0
for i in D:
    if i<=x:
        cnt+=1
print(cnt)

Submission status: Accepted

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

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

h = 0  # place
f = 1

for i in range(n):
    h += l[i]

    if h > x:
        f = 0
        break

print(1+i+f)

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

Solution code:
import itertools
N, X = [int(_) for _ in input().split()]
print(
    sum([
        1 for _ in list(
            itertools.accumulate([0] + [int(_) for _ in input().split()]))
        if _ <= X
    ]))

Submission status: Accepted

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

if sum(L) < X:
  print(N+1)
  exit()

for i in range(N):
  jumpNumber = jumpNumber + L[i]
  if jumpNumber > X:	
  	print(i+1)
  	break
  elif jumpNumber == X:
    print(i+2)
    break
  else:
    pass

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

d = 0

count=1

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

print(count)

Submission status: Accepted

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

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


plused = 0
count = 1
for v in l:
  plused += v
  if plused <= x:
    count += 1
  else:
    break

print(count)

Submission status: Accepted

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

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

dis = 0
cnt = 1

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
from itertools import accumulate
D = [0] + list(accumulate(L))
D_ = [d for d in D if d<=X]

print(len(D_))

Submission status: Accepted

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

Submission status: Accepted

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math 
ni = lambda: int(ns())
na = lambda: list(map(int, input().split()))
ns = lambda: input()
N,X = na()

L = na()
c=1
tmp=0
for i in L:
    tmp += i
    if(tmp>X):
        break
    c+=1
print(c)

Submission status: Accepted

Solution code:

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

ans = 1
cur_X = 0
pos_N = 0

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

    if cur_X > X:
        ans -= 1
        break

print(ans)

Submission status: Accepted

Solution code:
#coding:utf-8

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

l.insert(0,0)

# print(l)

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

print(ans)

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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

N = INPUT[0]
X = INPUT[1]

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

vvv = 0
i = 0
while(vvv <= X):
    count += 1
    if(i >= N):
        break
    vvv += L[i]
    i += 1

print(count)

Submission status: Accepted

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

print(con)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n, x = input().split()
l = input().split()
l.insert(0,0)
a = 0
flag = 0
for i in range(int(n)+1):
    a = a + int(l[i])

    if a > int(x):
        print(i)
        flag = 1
        break

if flag == 0:
    print(int(n)+1)

Submission status: Accepted

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

d = 0
r = 0 

for l in L:
    d = d + l 
    if d > X: break
    r += 1

print(r+1)

Submission status: Accepted

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

length=0
count=1
for i in range(len(li)):
  length+=li[i]
  if length>x:
    break
  count+=1
print(count)

Submission status: Accepted

Solution code:
nx = [ int(x) for x in input().split(" ")]
ln = [ int(x) for x in input().split(" ")]
sum = 0
for i in range(nx[0]):
    sum += ln[i]
    if sum > nx[1]:
        break

if i == nx[0] - 1 and sum <= nx[1]:
    i += 1

print(i + 1)