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

Submission status: Accepted

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

d = 0
count = 1
for a in ls:
    d += a
    if d <= x:
        count += 1

print(count)

Submission status: Accepted

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

for i, l in enumerate(L, 1):
    D += l
    if D > X:
        print(i)
        exit()
print(N+1)

Submission status: Accepted

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

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

boundCount = 1

D = 0

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

print(boundCount)

Submission status: Accepted

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

Submission status: Accepted

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

d = [0]
for j in range(len(l)):
    d.append(d[-1]+l[j])
# print(type(d[0]))
count = 0
for o in range(len(d)):
    if d[o]<=x:
        count+=1
    else:
        count+=0
print(count)

Submission status: Accepted

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

RES = []
ichi = 0
RES.append(ichi)
for i in LIST:
    ichi = ichi + i
    RES.append(ichi)

cnt = 0
for i in RES:
    if i <= X:
        cnt = cnt + 1

print(cnt)

Submission status: Accepted

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

li_w = [0]

for num in li_l:
    li_w.append(li_w[-1] + num)

print(len(list(filter(lambda y: y <= x, li_w))))

Submission status: Accepted

Solution code:
import math
import fractions
import copy
import numpy as np
def j(q):
    if q==1: print("POSSIBLE")
    elif q == 0:print("IMPOSSIBLE")
    exit(0)
rem = pow(10,9)+7
"""
def ct(x,y):
    if (x>y):print("+")
    elif (x<y): print("-")
    else: print("?")
"""

def ip():
    return int(input())
def iprow():
    return [int(i) for i in input().split()]
def printrow(a):
    for i in a:
        print(i)
def combinations(n,r):
    if n<r:return 0
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
def permutations(n,r):
    if n<r:return 0
    return math.factorial(n) // math.factorial(n - r)
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

#n = ip()                                     #入力整数1つ
x,y= (int(i) for i in input().split())       #入力整数横2つ以上
#a = [int(i) for i in input().split()]        #入力整数配列
#a = input()                                  #入力文字列
#a = input().split()                          #入力文字配列
#n = ip()                      #入力セット(整数改行あり)(1/2)
#a=[ip() for i in range(m)]    #入力セット(整数改行あり)(2/2)
#a=[input() for i in range(n)]    #入力セット(整数改行あり)(2/2)
#jの変数はしようできないので注意
#a.pop(0)は10^5あるときTLEしやすい!注意!抜くなら逆ソート!

a = iprow()

dp = [0]
for i in range(1,x+1):
    dp.append(dp[i-1]+a[i-1])
s = 0
while dp[s] <= y and s<=x-1 :s+=1
if s == x and dp[s]<=y :s+=1
print(s)

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

for l in L:
    now += l
    if now <= X:
        res += 1

print(res)

Submission status: Accepted

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

now = 0
res = 1
for l in L:
    now += l
    if now <= X:
        res += 1
    else:
        break
print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,k=map(int,input().split())
l=[int(s) for s in input().split()]
re=[0]
cnt=0
for i in range(len(l)):
  re.append(re[i]+l[i])
for i in range(len(re)):
  if re[i]<=k:
    cnt+=1
print(cnt)

Submission status: Accepted

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

L=[n]

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

first=0
jump=1
for i in L:
    D=first+i
    first=D
    if(D<=x):
        jump+=1

print(jump)

Submission status: Accepted

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

counter = 1
place = 0

for num in l:
    place += num
    if place > x:
        break
    counter += 1

print(counter)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding:utf-8

import sys

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)
        sys.exit()

print(N+1)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
n, x = [int(elem) for elem in input().split()]
ls = [int(elem) for elem in input().split()]
scores = [sum(ls[0:i]) for i in range(0, len(ls)+1)]

cnt = 0
for s in scores:
  if s <= x:
    cnt += 1
  else:
    break
print(cnt)

Submission status: Accepted

Solution code:
from  bisect import bisect_right
from itertools import accumulate

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

L =list(accumulate(l))
print(bisect_right(L,x)+1)

Submission status: Accepted

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

ans=0

def d(i):
    if i==1:
        return 0
    else:
        return d(i-1)+L[i-2]

for i in range(1,N+2):
    if d(i)>X:
        print(i-1)
        exit()

print(N+1)

Submission status: Accepted

Solution code:
inp_1 = input().split()
n = int(inp_1[0])
x = int(inp_1[1])
l_in = input().split()

count = 1 # 初回
d = 0
for i in range(n):
    if d + int(l_in[i]) > x:
        break
    else:
        count = count+1
        d = d + int(l_in[i])
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

result = 1

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

print(result)

Submission status: Accepted

Solution code:
#-*- coding: utf-8 -*-
N,X = map(int,input().split())
li = list(map(int,input().split()))
d = 0
count = 1
for i in range(len(li)):
  d += li[i]
  if d <= X:
    count += 1
  else:
    break
print(count)

Submission status: Accepted

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

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

t = 0
c = 0
for v in L:
    if t <= X:
        c += 1
        
    t += v
    
if t <= X:
    c += 1
    
print(c)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

D = 0
count = 1

for l in L:
    D += l
    if D <= X:
        count += 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,x = map(int,input().split())
l = [ int(i) for i in input().split() ]
st = 0
cnt = 1
for i in range(0,n):
  st += l[i]
  if st > 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
for i,leng in enumerate(l):
    s += leng
    if x<s:
        print(i+1)
        break
else:
    print(n+1)

Submission status: Accepted

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

for i in L:
  if NOW + i <= X:
    NOW += i
    c += 1
  else:
    break
print(c)

Submission status: Accepted

Solution code:
import math
import sys

#imgur.com/Pkt7iIf.png

#n, m = map(int, input().split())
#n = int(input())
#d = list(map(int, input().split()))

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

for i, p in enumerate(d):
    s += p
    if s > x:
        exit(print(i+1))
print(n+1)

Submission status: Accepted

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(i+1)
    break
  if D == X:
    print(i+2)
    break
  if D < X and i == N-1:
    print(i+2)
    break

Submission status: Accepted

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

while count<n and sum+l[count]<=x:
    sum=sum+l[count]
    count=count+1

print(count+1)

Submission status: Accepted

Solution code:
nx = input().split(' ')
n = int(nx[0])+1
x = int(nx[1])

l = input().split(' ')
llen = len(l)
d = 0
bound = 0
for i in range(n):
#  print(d)
  if d<=x :
    bound += 1
  if llen <= i:
    break
  d = d + int(l[i])

print(bound)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
# 行数を取得
import sys
list=[]
for line in sys.stdin:
    list.append(line)

NandX=list[0].split()

N=int(NandX[0])
X=int(NandX[1])

L=list[1].split()
D=0
i=0

if N==1:
    print(1)
else:
    while D<=X and i<=N-1:
        D=D+int(L[i])
        i+=1
        
    if i==N and D<=X:
        print(N+1)
    else:
        print(i)

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

print(c)

Submission status: Accepted

Solution code:
a,b =map(int,raw_input().split())
c=[]
c=map(int,raw_input().split())
iti=0
count=1
for i in range(0,a):
    iti+=c[i]
    if iti > b:
        break
    else:
        count+=1
print(count)

Submission status: Accepted

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

for i in range(1, n + 1):
    temp = data_list[i - 1] + l[i - 1]
    data_list.append(temp)

for item in data_list:
    if item <= x:
        result.append(item)
print(len(result))

Submission status: Accepted

Solution code:
n, x = map(int,input().split())
l = list(map(int,input().split()))
d = 0 #1回目の座標
#2回目以降
count = 1
for i in range (0,n):
    d = d + l[i]
    if(d > x):
        break
    count += 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,x=map(int,input().split())
arr=list(map(int,input().split()))
curr=0
bounce=1
i=0
while(i<n and curr+arr[i]<=x):
	curr+=arr[i]
	bounce+=1
	i+=1
print(bounce)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=input().split()
d=0
n=1
l=input().split( )
for p in range(int(a)):
  d+=int(l[p])
  if d<=int(b):
    n+=1
print(n)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(b_count)

Submission status: Accepted

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

Submission status: Accepted

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

counter = 1
l_sum = 0
for i in range(int(n)):
    l_sum += int(l[i])
    if l_sum <= int(x):
        counter += 1
print(counter)

Submission status: Accepted

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

ans=ans-1
if ky<=x:
    ans=ans+1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import bisect
n,x=map(int,input().split())
L=list(map(int,input().split()))
a=[0]*(n+1)
for i in range(1,n+1):
    a[i]=a[i-1]+L[i-1]
for i in range(n+1):
    if x==a[i]:
        print(bisect.bisect_right(a,x))
        exit()
print(bisect.bisect_left(a,x))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 1
total = 0
for l in L_lst:
  total += l
  if X >= total:
    ans += 1
  else:
    break
print(ans)

Submission status: Accepted

Solution code:
N, X = map(int, input().split())
L = list(map(int, input().split()))
ans = 1
x = 0
for l in L:
    x += l
    if x > X:
        break
    else:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
import sys
input=sys.stdin.readline
def main():
    n,x=map(int,input().split())
    l=list(map(int,input().split()))
    q=[0]*(n+1)
    for i in range(1,n+1):
        q[i]=q[i-1]+l[i-1]
    def bs(x):
        l=0 ; r=n
        while l<=r :
            m=(l+r)>>1
            if q[m] <= x :l=m+1
            else : r=m-1
        return l
    print(bs(x))
main()

Submission status: Accepted

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

ans,D=1,0

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

Submission status: Accepted

Solution code:
N,X=[int(x) for x in input().split(' ')]
arr=[int(x) for x in input().split(' ')]
temp=0
flag=0
for x in range(N):
  if arr[x]+temp>X:
    temp=x
    flag=1
    break
  else:
    temp+=arr[x]
if flag:
  print(temp+1)
else:
  print(N+1)

Submission status: Accepted

Solution code:
# こっちの方がわかりやすい気がする
N, X = map(int, input().split())
l_list = list(map(int,input().split()))

d_list = [0,]
s = 0
for l in l_list:
    s += l
    d_list.append(s)

for i,d in enumerate(d_list):
#     print(i,d)
    if d>X:
        cnt = i
        break
    if i == N:
        cnt = i+1
        break

print(cnt)

Submission status: Accepted

Solution code:
from itertools import accumulate
from bisect import bisect
_, x = map(int, input().split())
print(1 + bisect(list(accumulate(map(int, input().split()))), x))

Submission status: Accepted

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

D = []
D.append(0)

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

n = sum(x <= X for x in D)
print(n)

Submission status: Accepted

Solution code:
#やり直し
N, X = map(int, input().split())
l_list = list(map(int,input().split()))

d = 0
for i,l in enumerate(l_list):
    d += l

    if d > X:
        break

    if i == N-1:
        i += 1
    
print(i+1)

Submission status: Accepted

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

cor = 0
counter = 1
for i in range(N):
	cor += L[i]
	if cor > X:
		break
	else:
		counter += 1

print(counter)

Submission status: Accepted

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

for i in range(1,N+1):
  aaaa = D[i-1] + L[i-1]
  D.append(aaaa)
n = sum(x<=X for x in D)
print(n)

Submission status: Accepted

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

d = 0
k = 1

for _l in l:
	d += _l
	if d > x:
		break
	k += 1
	
print(k)

Submission status: Accepted

Solution code:
def main():
  _, x = map(int, input().split())
  s = list(map(int, input().split()))
  d = 0
  c = 1

  for v in s:
    d += v

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = map(int,input().split(" "))
ar = list(map(int,input().split(" ")))
ar.insert(0,0)
c = 0
ans = 0
for r in ar:
    c += r
    if c <= b:
        ans += 1
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

d = 0
count = 1

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

print(count)

Submission status: Accepted

Solution code:
N, X = [int(nx) for nx in input().split()]
L = [int(l) for l in input().split()]
jump = 1
x_value = 0
for n in range(N):
  x_value += L[n]
  if x_value <= X:
    jump += 1
  else:
    break
print(jump)

Submission status: Accepted

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

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

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

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

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

count = 1
place = 0
for coordinate in coordinates:
  place += coordinate
  if place > x:
    break
  else:
    count += 1
    continue
print(count)

Submission status: Accepted

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

D = [0]
for i, l in enumerate(L):
  D.append(D[i] + L[i])

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

Submission status: Accepted

Solution code:
N, X = map(int, input().split())
steps = list(map(int,input().split()))
 
x = 0
count = 1

for i in steps:
    x += i
    if x <= X:
        count += 1
 
print(count)

Submission status: Accepted

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

cur_pos = 0
num_jumps_under_X = 1
for L in L_list:
    cur_pos += L
    if cur_pos <= X:
        num_jumps_under_X += 1
print(num_jumps_under_X)

Submission status: Accepted

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

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

c = 1
p = 0
for l in L:
  p += l
  if p > X:
    break
  else:
    c += 1
print(c)

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

Solution code:
import logging

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

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

logging.info(L)

length = 0
counter = 1

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

Submission status: Accepted

Solution code:
from functools import reduce

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

    D = 0
    Ds=[D]
    for Li in L:
        D += Li
        Ds.append(D)

    print(len([a for a in Ds if a<=X]))




if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n,x = map(int, input().split())
l=list(map(int, input().split()))
dic = {}
dic[0] = 0
dic[1] = l[0]
for i in range(n-1):
    dic[i+2] = l[i+1]+dic[i+1]
res = list(filter(lambda a:a<=x,list(dic.values())))
print(len(res))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

D = 0
count = 1
for L in L_list:
    D += L
    if D > X:
        break
    count += 1

print(count)

Submission status: Accepted

Solution code:
import numpy as np
n,x=map(int,input().split())
l = list(map(int,input().split()))
y = [0]
for i in range(n):
  y.append(y[i]+l[i])
y = np.array(y)
print(np.count_nonzero(y<=x))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(i)

Submission status: Accepted

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

print(i)

Submission status: Accepted

Solution code:

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

cnt = 1
bounce = 0

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

Submission status: Accepted

Solution code:
N, X = map(int, input().split())
list = list(map(int, input().split()))
list.insert(0, 0)
position = 0
bound = 0

for i in list:
    position += i
    if(position <= X):
        bound += 1

print(bound)

Submission status: Accepted

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

Submission status: Accepted

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

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

count = 1
previous = 0

for i in range(N):
    now = previous + L[i]
    if now > X:
        break
    else:
        count += 1
    
    previous = now

print(count)

Submission status: Accepted

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

print(counter)

Submission status: Accepted

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

tmp=0
for i,element in enumerate(L):
	tmp+=element
	if tmp>X:
		print(i+1)
		break;
	if i==N-1:
		print(N+1)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, x = map(int, input().split())
b = 1
d = 0
for li in map(int, input().split()):
    d += li
    if d > x:
        break
    else:
        b += 1
print(b)

Submission status: Accepted

Solution code:
N, X = [int(x) for x in input().split()]
L = [int(x) for x in input().split()]
cnt = 1
all_sum = 0

for i in L:
  all_sum += i
  if all_sum <= X:
    cnt += 1
  else:
    break
print(cnt)

Submission status: Accepted

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

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

ans = 1
h = 0
for Li in L:
    h += Li
    if h <= X:
        ans += 1
    else:
        break

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X,L=map(int,input().split())
N=input().split()
d=0
ans=1
for i in N:
  d+=int(i)
  if d<=L:
    ans+=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
line = input()
numbers = line.split(" ")
n = int(numbers[0])
max = int(numbers[1])

line = input()
lList = line.split(" ")
d, count = 0, 1
for i in range(n):
  d += int(lList[i])
  if d <= max:
    count += 1
  
print(count)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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