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

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

D = [0 for x in range(N+1)]

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

a = [x for x in D if x <= X]
ans = len(a)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if sum(l) <= x:
    print(n+1)
    exit()

len = 0
for ind, ll in enumerate(l):
    len += ll
    if len > x:
        print(ind + 1)
        exit()

Submission status: Accepted

Solution code:
n,x=list(map(int, list(input().split())))
Ls=list(map(int, list(input().split())))
t=1
for i in range(n):
    if sum(Ls[:i+1]) > x:
        break
    t+=1
print(t)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#16 ABC130B
n,x=map(int,input().split())
l=list(map(int,input().split()))
a=[0]
for i in range(n):
    a.append(a[-1]+l[i])
j=True
for i in range(len(a)):
    if a[i]>x:
        print(i)
        j=False
        break
if j:
    print(n+1)

Submission status: Accepted

Solution code:
nx=input().split()
l=input().split()

nx=[int(x) for x in nx]
l=[int(n) for n in l]

buf=0
count=1

for i in range(nx[0]):
    buf=buf+l[i]
    if nx[1]>=buf:
        count+=1

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

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

    print(count)


main()

Submission status: Accepted

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

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

count = 1
sm = 0

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

print(count)

Submission status: Accepted

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

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

k = 0
s = []
for i in range(n):
  k += l[i]
  s.append(k)

c = 0
for i in s:
  if i <= x:
    c += 1

print(c+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

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

N=temp[0]
X=temp[1]

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

ind=1
while np.sum(L[:ind])<=X and ind<=N:
  ind+=1
  
print(ind)

Submission status: Accepted

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

D = 0
ans = N + 1
for i, v in enumerate (L, 1):
    D += v
    if D > X:
        ans = i
        break
    
print(ans)

Submission status: Accepted

Solution code:

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

sum = 0
count = 1
for l in ls:
    sum += l
    if sum <= x:
        count += 1

print(count)

Submission status: Accepted

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

z = [0]
for i in range(1, n+1):
    z += [z[i-1] + ls[i-1]]

#print(z)

count = 0
for c in z:
    if c <= x:
        count += 1

print(count)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

count = 1
sigma = 0
for l in L:
    sigma += l
    if sigma > x:
        break
    else:
        count += 1
print(count)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
#
import sys

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

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

Submission status: Accepted

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.append(a)
print(sum(1 for x in b if x <= X))

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

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

d = [0]
acc = 0
for i in range(n):
    acc += l[i]
    d.append(acc)

print(len([i for i in d if i <= x]))

Submission status: Accepted

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

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

print(a)

Submission status: Accepted

Solution code:
n, x = [int(i) for i in input().split()]
l = [int(i) for i in input().split()]
count = 0
try:
    for i, c in enumerate(l):
        count += c
        if count>x:
            p = i+1
            break
    print(p)
except:
    print(n+1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

c = 1
d = 0

for i in range(n):
    d += l_list[i]
    if d <= x:
        c += 1
    else:
        break

print(c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def iread():
    return int(input())


def sread():
    return input()


def aread_int():
    tmp = input().split()
    ret = [int(i) for i in tmp]
    return ret


def aread_str():
    return input().split()

if __name__ == '__main__':
    n, x = map(int, input().split())
    l = aread_int()
    current = 0
    cnt = 0
    while cnt < n and current + l[cnt] <= x :
        current += l[cnt]
        cnt += 1
    
    print(cnt + 1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
N, X = map(int, input().split())
a = list(map(int,input().split()))
cum_a = np.cumsum(a)
print(sum(x<=X for x in cum_a)+1)

Submission status: Accepted

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

N = inputNum[0]
X = inputNum[1]

D = [0]
# 座標0を含める
count = 1

for i, l in enumerate(L):
    # D[i+1]を求める
    D.append(D[i] + l)
    if(D[i+1] <= 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]
for l in L:
    D.append(D[-1]+l)

ans = 0
for d in D:
    if d <= X:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
N, X = (int(_) for _ in input().split())
L = list(map(int, input().split()))
D = [0 for i in range(N + 1)]
ans = 0
for i in range(N):
    D[i + 1]= D[i] + L[i]
for i in range(N + 1):
    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,c=0,1
for i in range(N):
    D+=L[i]
    if D<=X:
        c+=1
    else:
        break
print(c)

Submission status: Accepted

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

Submission status: Accepted

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

D=[0, 0]
count=1
for n in range(N):
  D[1] = D[0] + L_i[n]
  if D[1] <= X:
    count += 1
    D[0] = D[1]
  else:
    break

print(count)

Submission status: Accepted

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

d = 0
for i, l in enumerate(ls):
    d += l
    if (d > x):
        print(i+1)
        exit()

print(len(ls)+1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

sum = 0
count = 1

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n,x=map(int, input().split())
l_list=list(map(int, input().split()))
#print(l_list)
cnt=1
bound=0
for a in range(n):
    bound=bound+l_list[a]
    if bound<=x:
        cnt+=1
        continue
    else:
        break
print(cnt)

Submission status: Accepted

Solution code:
n, x = (int(i) for i in input().split())  
l = list(int(_) for _ in input().split()) 
distance=0
_count=1
for i in range(0, n):
    distance += l[i]
    if distance<=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
ans = 1
for i in range(n):
    d += l[i]
    if d <= x:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
N, X =  [int(e) for e in input().split()]
lst = [int(e) for e in input().split()]
cnt = 0
for i in range(N+1):
  if i == 0:
    num = 0
  else:
    num = num + lst[i-1]
  if num <= X:
    cnt += 1
print(cnt)

Submission status: Accepted

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

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(1,N+1):
  d += L[i-1]
  if d <= X:
  	ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

    print(count)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n,x=[int(i) for i in input().split()]
a=[int(i) for i in input().split()]
ans=1
curr=0
ind=0
while(curr<=x):
    if(ind>=n):
        break
    curr+=a[ind]
    ind+=1
    if(curr>x):
        break
    ans+=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
from sys import stdin


def main():
    N, X = [int(x) for x in stdin.readline().rstrip().split()]
    L_list = [int(x) for x in stdin.readline().rstrip().split()]

    count = 1
    D = 0

    for L in L_list:
        D = D + L
        if D <= X:
            count += 1
        else:
            break

    print(count)


if __name__ == "__main__":
    main()

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

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

print(c)

Submission status: Accepted

Solution code:
n,x=map(int,input().split());c=0
for i in input().split():
  x-=int(i);c+=1
  if x<=0:c+=(x==0);break
  c+=(c==n)
print(min(n+1,c))

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())
A = list(map(int,input().split()))
L = 0
count = 1

for i in range(N):
  L += A[i]
  if(L <= X): count += 1
  else: break

print(count)

Submission status: Accepted

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

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

print(res)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
# ABC130, B - bounding
n, x = map(int, input().split(' '))
L = [int(el) for el in input().split(' ')]

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

Submission status: Accepted

Solution code:
i = input().split(" ")
n = int(i[0])
x = int(i[1])
l = input().split(" ")
height = 0
count = n+1

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

print(count)

Submission status: Accepted

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

D = 0
count = 1

for l in L:
    D += l

    if D <= X:
        count += 1

    else:
        break

print(count)

Submission status: Accepted

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

for i in range(n):
    n1 += li[i]
    
    if n1 <= x:
        an += 1
    else:
        break

print(an)

Submission status: Accepted

Solution code:
N, X = map(int, input().split())
L = list(map(int, input().split()))
while len(L) != 0:
    if sum(L) <= X:
        print(len(L) + 1)
        exit()
    else:
        L.pop()

Submission status: Accepted

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

def main():
	n, x = map(int, input().strip().split())
	L = list(map(int, input().strip().split()))
	i = 0
	c = 1
	for l in L:
		i += l
		if i > 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()))
def d(i):
    if i == 0:
        return 0
    else:
        return d(i-1) + l[i-1]
count = 0
for j in range(n+1):
    if d(j) <= x:
        count += 1
print(count)

Submission status: Accepted

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

length = 0
ans = 0

for i in range(n+1):
    if length <= x:
        ans += 1
        if i != n:
            length += L[i]
    else:
        break

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, X = map(int, input().split())
arrL = list(map(int, input().split()))
dist = 0
count = 1
for i in range(N):
  dist += arrL[i]
  if dist <= 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(" ")]

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

Submission status: Accepted

Solution code:
INPUT_SENTENCES = 2
ss = [input() for i in range(INPUT_SENTENCES)]
N = int(ss[0].split(" ")[0])
X = int(ss[0].split(" ")[1])
L = [int(i) for i in ss[1].split(" ")]
D = [0]
for i in range(1, N + 1):
    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())
a = list(input().split())
a = [int(i) for i in a]
x = 0
bc = 1
for i in range(N):
        x += a[i]
        if x > X: break
        bc += 1
print(bc)

Submission status: Accepted

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

for d in D:
    if d <= X:
        bounding += 1

print(bounding)

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(1,n+1):
    d.append(d[i-1]+l[i-1])
    if d[i]<=x:
        ans+=1
    else:
        ans+=0

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

print(count)

Submission status: Accepted

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

pf = [arr[0] for i in range(n)]

for i in range(1, n):
    pf[i] = pf[i-1] + arr[i]

c = 0
for i in pf:
    c += (i <= x)

print(c+1)

Submission status: Accepted

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

c_t = 1
now = 0

for count in range(n):
    now += lis[count]
    if now <= x:
        c_t += 1

print(c_t)

Submission status: Accepted

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

D = 0
ans = 1 if D <= X else 0
for item in inputs:
    D += item
    if D <= X:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
A = input()

A = A.split()

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

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

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

print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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

count = 1
dist = 0
for l in l_l:
    dist += l
    if dist > x:
        break
    else:
        count += 1

print(count)

Submission status: Accepted

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

for j in range(0, n):
    if jmp+L[j] <= x:
        cnt += 1
    jmp = jmp + L[j]
    
print(cnt)

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):
    if d+l[i]<=x:
        ans+=1
    d+=l[i]
print(ans)

Submission status: Accepted

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

if __name__ == "__main__":
    main15()

Submission status: Accepted

Solution code:
N = [int(i) for i in input().split()]
K = [int(i) for i in input().split()]
s = 0
c = 1
for i in K:
    s += i
    if s > N[1]:
        break
    else:
        c += 1
print(c)

Submission status: Accepted

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

Submission status: Accepted

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

count = 0
p = 0
for l in L:
    if p <= x:
        p += l
        count += 1
if p <= x:
    count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

if __name__ == "__main__":
    B_Bounding()

Submission status: Accepted

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

Submission status: Accepted

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

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

print(cnt)

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

Submission status: Accepted

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

print(cnt)

Submission status: Accepted

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

d=[0]
for v in l:
    d.append(d[-1]+v)

print(len([v for v in d if v <= X]))

Submission status: Accepted

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

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

ans = int(1)
t = int(0)
for i in range(n):
    t += int(L[i])
    if t <= x:
        ans += 1

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N, X = list(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:
N,X= [int(s) for s in input().split()]
lst = [int(s) for s in input().split()]
dist=0
count=0
while(count<N):
  dist=dist+lst[count]
  if(dist>X):
    break
  count=count+1
print(count+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.append(d[i] + l[i])

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

n3 = [int(j) for j in input().split()]

c4 = 1
n5 = 0

for i6 in range(n1):
    n5 += n3[i6]
    if n5 <= n2:
        c4 += 1
    else:
        break

print(c4)

Submission status: Accepted

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

now = 0
count = 1
for i in L_list:
    now += i
    if now <= X:
        # print(now)
        count += 1

print(count)

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(1,n+1):
    d.append(d[i-1]+l[i-1])
    if d[i-1]+l[i-1]<=x:
        count += 1
print(count)

Submission status: Accepted

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

D = [0]#D1 = 0
for i in range(1,N+1):#座標Dの配列を作る
    Di = D[i-1] + L[i-1]
    D.append(Di)

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

Submission status: Accepted

Solution code:
n,Xmax=map(int,input().split())
L=list(map(int,input().split()))
x=0
count=1
while x+L[0]<=Xmax:
  count+=1
  x+=L.pop(0)
  if len(L)==0:
    break
print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding:utf-8
n, x = map(int, input().split())
l = list(map(int, input().split()))

d = [0]

#跳ねる座標を計算
for i in range(1, n+1):
    tmp = d[i-1] + l[i-1]
    d.append(tmp)

#print(d)

#判定
counter = 0

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

print(counter)

Submission status: Accepted

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

Submission status: Accepted

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