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 = [int(_) for _ in input().split()]
INF = 10**12
D = [INF]*(N+1)
D[0] = 0
for i in range(1,N+1):
    D[i] = D[i-1] + L[i-1]
n = [1 for _ in D if _ <= X]
print(sum(n))

Submission status: Accepted

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

Submission status: Accepted

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

bounce_list = [0] * (N + 1)
for i in range(1, N + 1):
    bounce_list[i] = bounce_list[i - 1] + l_list[i - 1]

print(len([i for i in bounce_list if i <= X]))

Submission status: Accepted

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

d=0
cnt=0
for i in range(N+1):
    if d>X:
        break
    elif i==N:
        cnt+=1
    else:
        d+=L[i]#next
        cnt+=1
   
print(cnt)

Submission status: Accepted

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

print(N+1)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:

def gcd_core(a, b):
    if b == 0:
        return a
    else:
        return gcd_core(b, a % b)


def gcd(arr):
    g = gcd_core(arr[0], arr[1])
    for i in range(2, len(arr)):
        g = gcd_core(g, arr[i])
    return g

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

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

Submission status: Accepted

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

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

print(j)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

result = 1
for i in range(inputa[0]):
  inputa[1] -= inputb[i]
  if inputa[1] < 0:
    break
  else:
    result += 1

print(result)

Submission status: Accepted

Solution code:
n,x = map(int,input().split())
L = list(map(int,input().split()))
res = 1
now = 0
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()))
cur = 0
for i in range(n):
  cur += l[i]
  if cur > x:
    print(i+1)
    break
  if i == n-1:
    print(n+1)

Submission status: Accepted

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

if __name__ == "__main__":
    solve()

Submission status: Accepted

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

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

flag = True
for i in range(n+1):
    if li[i]>x:
        ans = i
        flag = False
        break

if flag:
    print(n+1)
else:
    print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

X = NX[1]

bound = 1
point = 0

for i in range(len(L)):
    point += L[i]
    if point <= X:
        bound += 1

print(bound)

Submission status: Accepted

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

count = 1
total_b = 0

for b in bound_list:
    total_b += b
    if total_b <= X:
        count += 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

D, ans = 0, 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()))

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

Submission status: Accepted

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

Submission status: Accepted

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

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

lx = 0
cnt=1
for pl in l:
  lx += pl
  if lx > x:
    break;
  cnt += 1

print(cnt)

Submission status: Accepted

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

x = 0
ans = 1
for l in L:
    x += l
    if x <= X:
        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 i in range(n):
    d+=l[i]
    if d<=x:
        ans+=1
print(ans)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

def main():
    N, X = map(int, input().split())
    A = list(map(int, input().split()))

    cnt = 0
    D = 0
    for a in A:
        D += a
        cnt += 1
        if D > X:
            cnt -= 1
            break

    return cnt+1


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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def judge(x):
  return 1 if x <= X else 0

N, X = list(map(int, input().split()))
L = list(map(int, input().split()))
D = [0] * (N + 1)
for n in range(1, N + 1):
  D[n] = D[n - 1] + L[n - 1]
print(list(map(judge, D)).count(1))

Submission status: Accepted

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

c = 0
for i, jump in enumerate(l):
    c += jump
    if c > x:
        print(i + 1)
        break
    elif i == n - 1:
        print(n + 1)

Submission status: Accepted

Solution code:
N, X = map(int,input().split(" "))
Ls = []
for i in input().split(" "):
  Ls.append(int(i))
Ds = [0]*(N+1)
cnt = 0
for i in range(1,N+1):
  Ds[i] = Ds[i-1] + Ls[i-1]
  if Ds[i] <= X: cnt += 1
print(cnt+1)

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 = D + l
    if D <= X:
        count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

total = 0

for lc,l in enumerate(list_l):
    total += l
    if (total > x):
        break

if (total <= x):
    lc += 1
print(lc + 1)

Submission status: Accepted

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

for i in range(1, N):
    if i == 1:
        L[i] = L[i] + L[0]
    else:
        L[i] = L[i] + L[i-1]
L.append(0)
for i in L:
    if i <= X:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
n=input().split()
a=input().split()
s=0
b=0
x=[0]
for i in range(int(n[0])):
    s+=int(a[i])
    x.append(s)
for i in range(len(x)):
    if x[i]<=int(n[1]):
        b+=1
print(b)

Submission status: Accepted

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

import sys
input = sys.stdin.readline

def io_generator():
	return input()

#+++++++++++++++++++

def main(io):
	n,x = map(int, io().split())
	ll= list(map(int, io().split()))
	pos=0
	if n > x:
		return 0
		
	cc=1
	for l in ll:
		pos += l
		if pos > x:
			break
		cc+=1
			
	return cc

#++++++++++++++++++++

if __name__ == "__main__":
	io= lambda : io_generator()
	print (main(io))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,x = map(int,input().split())
li = list(map(int,input().split()))
cnt = 0
total = 0
for i in li:
    total += i
    cnt += 1
    if total > x:
        break
if sum(li) <= x:
    print(len(li) + 1)
else:
    print(cnt)

Submission status: Accepted

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

for i in range(len(list)):
    bound_list.append(list[i]+bound_list[i])
    if bound_list[len(bound_list)-1]>x:
        print(i+1)
        flag=1
        break

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

Submission status: Accepted

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

ans = 0
d = 0
while(d <= x):
    if ans == n:
        ans += 1
        break
    d = d + l[ans]
    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()]
tmp, ans = 0, 1
for i in range(N):
    tmp += L[i]
    if tmp > X:
        print(ans)
        exit()
    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()))
sums=[0]*(N+1)
c=0
for i in range(1,N+1):
  sums[i] = sums[i-1] + L[i-1]

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

count = 1
res = 0
for l in l_list:
    res += l
    if res <= 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(" ")))

cnt = 0
d = 0

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

Submission status: Accepted

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

for i in range(N):
    goukei += L[i]
    if(goukei <= X):
        cnt += 1
    
print(cnt)

Submission status: Accepted

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

print(i+2)

Submission status: Accepted

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

d = 0
cnt = 1
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:
n,x=map(int,input().split())
l=list(map(int, input().split()))
d=0
dlist=[]
dlist.append(0)
for i in range(1,n+1):
    d=d+l[i-1]
    if d <= x:
        dlist.append(d)
print(len(dlist))

Submission status: Accepted

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

count = 1
current = 0
for l in ls:
    current += l
    if x >= current:
        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()]
count = 0
zahyou = [0]
for i in range(n):
    zahyou.append(int(zahyou[i])+L[i])
for i in range(len(zahyou)):
    if zahyou[i]<=x:
        count+=1
print(count)

Submission status: Accepted

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

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

lenge = 0
counter = 0
ans_list = [0]
tmp = 0
for i in range(len(num_list)):
    tmp += num_list[i]
    ans_list.append(tmp)


for s in range(len(ans_list)):
    if ans_list[s] <= X:
        counter += 1
    
    else:
        break

print(counter)

Submission status: Accepted

Solution code:
NX = [int(i) for i in input().split()]
L = [int(i) for i in input().split()]
L.insert(0,0)
answer = 0
sum = 0
for i in range(len(L)):
    sum += L[i]
    if(sum > NX[1]):
        break
    else:
        answer += 1
print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

    if d > X:
        break
    cnt += 1
#     if i == N-1:
#         if d <= X:
#             cnt += 1
    
print(cnt)

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

now = 0
i = 0
while i < N:
    now += L[i]
    if now <= X:
        i += 1
    else:
        break

print(i + 1)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
nx = input().split()
n = int(nx[0])
x = int(nx[1])
ls = input().split()
ls = [int(num) for num in ls]

def main():
    c = 1
    ds = [0]
    for i in range(1,n+1):
        nxt = ds[i-1] + ls[i-1] 
        if nxt > x:
            print(c)
            return
        ds.append(nxt)
        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()))
count = 1
dist = 0
for item in L:
	dist += item
	if dist <= 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()))
dist = [0]
for i in range(1, n+1):
  dist.append(dist[i-1] + l[i-1])
print(len([i for i in dist if i <= x]))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

count = 1
zahyo = 0

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

print(count)

Submission status: Accepted

Solution code:
import numpy as np


def solve():
    n, x = [int(i) for i in input().split()]
    l = np.array([int(i) for i in input().split()])

    if x == 0:
        print(0)
        exit(0)

    d = 0
    ans = 1

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

    print(ans)


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
n,x=map(int,input().split())
l=map(int,input().split())
L=list(l)
s=1
D=0

for i in range(0,n):
    D=D+L[i]
    if D<=x:
        s=s+1


print(s)

Submission status: Accepted

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

print(cnt)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
AtCoder A
"""

import sys, math, random
import numpy as np

# N = int(input())
# A = list(map(int,input().split())) # N row 1 column
# A = [int(input()) for _ in range(N)] # 1 row N column
# S = str(input()) # str(input()) == input() -> 'abc'
# S = list(input()) # abc -> ['a','b','c']
# S.replace('ABC','X') # "testABCABC" -> "testXX"
 
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]
 
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()


def main():
    N, X = list(map(int,input().split()))
    L=LI()
    L1=0
    out=1
    for l in L:
        D=L1+l
        # print(D)
        if D<X+1:
            out+=1
        L1=D
    print(out)
    
if __name__ == "__main__":
    main()

Submission status: Accepted

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

import sys

debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        lines.append(input())
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]

    tokens = lines[0].split(" ")
    n = int(tokens[0])
    x = int(tokens[1])
    ls = [int(l) for l in lines[1].split(" ")]

    return (n, x, ls)


def solve(n, x, ls):

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


    return count


def main():
    # 出力

    print("%s" % solve(*parse_input()))

#    solve(*parse_input())

if __name__ == '__main__':

    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

print(len(ans))

Submission status: Accepted

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

Submission status: Accepted

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

count = 1
point = 0

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# from sys import exit
N, X = [int(n) for n in input().split()]
L = [int(n) for n in input().split()]
now = 0
ans = 1
for i in range(len(L)):
    now += L[i]
    if now > X:
        break
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
n, x=map(int, input().split())
L=[i for i in map(int, input().split())]
counter=1
place=0
for i in range(n):
    place+=L[i]
    if place<=x and i!=n-1:
        counter+=1
    elif place>x:
        print(counter)
        break
    elif place<=x and i==n-1:
        counter+=1
        print(counter)

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]
  if s > x:
    print(i+1)
    exit()

print(n+1)

Submission status: Accepted

Solution code:
from sys import stdin
import numpy as np

N, X = [int(x) for x in stdin.readline().rstrip().split()]
L = [int(x) for x in stdin.readline().rstrip().split()]

count = 1
dn = 0
dn_1 = 0

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

print(count)

Submission status: Accepted

Solution code:
N, X = map(int,input().split())
d_list = []
l_list = input().split()
d_list.append(0)
now_d = 0
for l in l_list:
  now_d += int(l)
  d_list.append(now_d)
ans = [i for i in d_list if X>=i ]
print(len(ans))

Submission status: Accepted

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

Submission status: Accepted

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


main()

Submission status: Accepted

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

d = 0
cnt = 1
for l in distances:
  d += l
  if d <= x:
    cnt += 1
  else:
    break

print(cnt)

Submission status: Accepted

Solution code:
def main():
    n,x = map(int,input().split(' '))
    l = list(map(int,input().split(' ')))
    distance = 0
    cnt = 1
    for i in l:
        distance +=i
        if distance <= x:
            cnt += 1
        else:
            break
    print(cnt)
if __name__=='__main__':
    main()

Submission status: Accepted

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

bound = [0]
ans = 1

for i in range(n):
    bound.append(bound[i] + l[i])
    ans += 1
    if bound[-1] == x:
        break
    elif bound[-1] > x:
        ans -= 1
        break

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

Submission status: Accepted

Solution code:
# coding: utf-8
n, x = list(map(int, input().split()))
l  = list(map(int, input().split()))
s = 0
l2 = [0]
c = 1
for _l in l:
    s += _l
    if s > x:
        break
    else:
        c += 1
print(c)

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 = D[i-1] + L[i-1]
  if d <= X:
    cnt = cnt + 1
  D.append(d)

print(cnt)

Submission status: Accepted

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

p = 0
c = 1
for s in l:
    p += s
    if p <= x:
        c += 1
    
print(c)

Submission status: Accepted

Solution code:
import numpy as np

n, x = map(int, input().split())
l = list(map(int, input().split()))
result = [0]
for i in l:
    result.append(result[-1] + i)

print((np.array(result) <= x).sum())

Submission status: Accepted

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

cnt = 0
ans = 0
for i in range(N):
    if cnt > X:
        cnt += L[i]
    else:
        cnt += L[i]
        ans += 1

if cnt <= X:
    ans += 1

print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

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

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

tmp = 0
for il,i in zip(l,range(len(l))):
    tmp+=il
    if tmp > x:
        i-=1
        break
    
if l[0] <= x:
    print(i+2)
else:
    print(0)

Submission status: Accepted

Solution code:
if __name__ == "__main__":
  NX = input().split(" ")
  LN = input().split(" ")
  
  sum = 0
  count = 1
  for i in range(int(NX[0])):
    sum = sum + int(LN[i])
    if sum <= int(NX[1]):
      count += 1
  print(count)

Submission status: Accepted

Solution code:
N, X = [int(i) for i in input().split()]
ls = [int(i) for i in input().split()]
d = 0
list = [0]
for l in ls:
    d += l
    list.append(d)

print(len([i for i in list if i <= X]))

Submission status: Accepted

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

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

Submission status: Accepted

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

cnt = 0
for i in range(n):
    cnt += l[i]
    if cnt > 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()))
s = 0
c = 1
for l in L:
  s += l
  if s <= X and c <= N:
    c+=1
  else:
    break
print(c)

Submission status: Accepted

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

d = [0]

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

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    N, X = LI()
    L = LI()
    cur_x = 0
    cnt = 1
    for l in L:
        cur_x += l
        if cur_x > X:
            break
        cnt += 1
    print(cnt)
main()

Submission status: Accepted

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

jump = 0
high.append(jump)

for i in range(N):
  jump = jump + lst[i]
  if jump <= X:
    high.append(jump)

print(len(high))

Submission status: Accepted

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

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

Distance = 0
Bound_times = 1

for j in range(N):
    Distance = Distance + L[j]
    if Distance <= X:
        Bound_times += 1
    else:
        break

print(Bound_times)

Submission status: Accepted

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

s = 0
k = 1
for i in range(N):
  s +=L[i]
  k += 1
  if s > X:
    k -= 1
    break

print(k)

Submission status: Accepted

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