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

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

print(count)

Submission status: Accepted

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

cnt = 1
l = 0

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

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:
_, X = map(int, input().split())
L = [int(i) for i in input().split()]
d = 0
for i, l in enumerate(L):
    d += l
    if d > X:
        break
if d > X: print(i+1)
else: print(i+2)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

    T[i] = T[i-1] + L[i-1]
for i in T:
    if i <= X:

        temp+=1
print(temp)

Submission status: Accepted

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

Submission status: Accepted

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

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

# solve
D = [0]
for i in range(N):
    D.append(D[i] + L[i])

ans = [e for e in D if e <= X]

# output
print(len(ans))

Submission status: Accepted

Solution code:
#入力（1次元）
N, X = list(map(int, input().split()))
L = list(map(int, input().split()))
D = [0] * 200
count = 1

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

print(count)

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

Submission status: Accepted

Solution code:
import math
x =  [int(s) for s in input().split()]
jump = [int(s) for s in input().split()]
p = 0
sum = 1
for i in range(x[0]):
    p += jump[i]
    if(p <= x[1]):
        sum += 1
print(sum)

Submission status: Accepted

Solution code:
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


# 初項s, 交差dのn個の数列の和
def sum_of_arithmetic_progression(s, d, n):
    return n * (2 * s + (n - 1) * d) // 2


# aとbの最大公約数
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


# aとbの最小公倍数
def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


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

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

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N, X = map(int,input().split())
ll = list(map(int,input().split()))
count = 1
D = 0
for i in ll:
    if D+i> X:
        print(count)
        exit()
    else:
        D += i
        count += 1
print(N + 1)

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()))
	pos = 0
	ans = 1
	for i in l:
		pos += i
		if pos > x:
			break
		ans += 1
	print(ans)

if __name__ == '__main__':
	main()

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
limit_num, limit_cor = tuple(int(i) for i in input().split(" "))
l_list = tuple(int(i) for i in input().split(" "))
dp = [0]


def jump_cor(n):
    if len(dp) < n + 1:
        dp.append(dp[n - 1] + l_list[n - 1])
    return dp[n]


for i in range(limit_num + 1):
    if jump_cor(i) > limit_cor:
        i -= 1
        break
print(i + 1)

Submission status: Accepted

Solution code:
# print max k (sum(l[0:k-1]) < x) l[0]+l[1]+...l[k-1] < x 
def main():
  n,x = map(int,input().split())
  l = list(map(int,input().split()))
  sum_l = 0
  ans = 0
  for i in range(n):
    sum_l += l[i]
    if sum_l > x:
      ans = i+1
      break
    ans = n+1 # when 
  print(ans)

main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N, X = map(int,input().split())
Llists = list(map(int,input().split()))
dist = 0
for i,Llist in enumerate(Llists):
    dist += Llist
    if X < dist:
        print(i + 1)
        break
else:
    print(N + 1)

Submission status: Accepted

Solution code:
import numpy as np
N,X = map(int, input().split())
L = [int(z) for z in input().split()]

D =  np.zeros(N+1)
for i in range(N):
    D[1+i] = D[i] + L[i]

print(np.count_nonzero(D<=X))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

r=1
p=0

for e in l:
    p+=e
    if p <= x:
        r+=1
    else:
        break

print(r)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(1,len(ls)):
    if ans[i] + ls[i] <= x:
        ans.append(ans[i] + ls[i])
    else:
        break
print(len(ans))

Submission status: Accepted

Solution code:

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

ans = 1
tmpx = 0
for i in range(n):
    if tmpx + li[i] > x:
        break
    ans += 1
    tmpx += li[i]

print(ans)

Submission status: Accepted

Solution code:
# 2つの入力を空白で分割し、数値化
n, x = map(int, input().split())

# 空白区切りの数値をリスト化
l = list(map(int, input().split()))
l.insert(0, 0) # 0 start


distance = 0
result = 0

for d in l:
   if distance + d <= x:
       distance += d
       result += 1
   else:
       break
print(result)

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# coding: utf-8

# In[ ]:


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


# In[ ]:


count = 1
dis_sum = 0
for l in Ls:
    dis_sum += l
    if dis_sum > X:
        print(count)
        break
    count += 1
else:
    print(count)

Submission status: Accepted

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

zahyou = 0
num = 1

for i in range(N):
    if zahyou + L[i] <= X:
        zahyou = zahyou + L[i]
        num += 1
    else:

        break

print(num)

Submission status: Accepted

Solution code:
N, X = (int(i) for i in input().split())
L = list(int(i) for i in input().split())  
d = 0
count = 1
for l in L:
    d = d + l
    if X >= d:
         count = count + 1
print(count)

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

Submission status: Accepted

Solution code:
s=input().split()
n=int(s[0])
x=int(s[1])
j=[]
d=input().split()
for i in range(n):
    j.append(int(d[i]))
d= 0
i=0
p=0
while d<=x:
    p+=1
    if i<=len(j)-1:
        d+=j[i]
    else:
        break
    i+=1
print(p)

Submission status: Accepted

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

count = 1
v = 0
for i in range(len(l)):
    v += l[i]
    if v <= x:
        count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

def accmulate(array):
    global cs
    cs = [0]*(len(array)+1)
    for i in range(len(array)):
        cs[i+1] = cs[i] + array[i]

def query(l,r):
    return cs[r+1] - cs[l]

accmulate(L)

cnt = 0
for a in cs:
    if a <= X:
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
def test():
    N, X = map(int, input().split())
    D = list(map(int, input().split()))
    d = 0
    for i in range(N):
        d += D[i]
        if d > X:
            print(i+1)
            return
    print(N+1)
    

if __name__ == '__main__':
    test()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

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

L_res = np.cumsum(np.array(L))
print(L_res[L_res <= X].shape[0]+1)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

point = 0

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

Submission status: Accepted

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

sum = 0
for i in range(1,n+1):
  sum += ls[i-1]
  if sum > x:
    print(i)
    quit()
print(n+1)

Submission status: Accepted

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


g = 0
cnt = 1
for l in L:
    g += l
    if X < g:
        break
    cnt += 1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

for s in i:
	a+=s
	if a <= X:
		d+=1
        
print(d)

Submission status: Accepted

Solution code:
N,X=list(map(int,input().split()))
i=list(map(int,input().split()))
listD=[0]
d=0

for s in i:
	d=d+s
	if d <= X:
		listD.append(d)
        
print(len(listD))

Submission status: Accepted

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

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):
  if i >= 1 and i <= N:
    D.append(D[i-1]+L[i-1])
print(len([int(y) for y in D if int(y) <= X]))

Submission status: Accepted

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

Submission status: Accepted

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

zahyo = 0
count = 1

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

Submission status: Accepted

Solution code:
d=0
c=0

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

for j in range(len(l)):
    if d<=x:
        d+=int(l[j])
        c+=1 

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
alfa=input().split()
N=int(alfa[0])
X=int(alfa[1])
#L=[int(input().split()) for i in range(N)]
L=input().split()

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

if D<=X:
    print(count)

Submission status: Accepted

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

line = list(input().split(" "))

total = 0
ans = 0
for i in range(n):
    if total > x:
        break
    else:
        total += int(line[i])
        ans += 1

if total <= x:
    print(n + 1)
else:
    print(ans)

Submission status: Accepted

Solution code:
def main():
    temp = map(int,raw_input().split())
    a = map(int,raw_input().split())
    n = 0
    cnt = 1
    for i in a:
        n = n + i
        if temp[1] >= n:
            cnt = cnt + 1
        else:
            break

    print(cnt)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n,x = map(int,input().split())
lm = list(map(int,input().split()))
ln = [0]
for a in range(len(lm)):
  ln.append(ln[a]+lm[a])
s = 0
for b in range(len(ln)):
  if ln[b] <= x:
    s += 1
print('{}'.format(s))

Submission status: Accepted

Solution code:
#数直線上を N+1 回跳ねるボールがあり、
#1 回目は 座標 D1=0, i 回目は 座標 Di=Di−1+Li−1(2≤i≤N+1) で跳ねます。
#数直線の座標が X 以下の領域でボールが跳ねる回数は何回でしょうか。

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

Submission status: Accepted

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

pos = 0
cnt = 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, x = map(int, input().split())
l = list(map(int, input().split()))
d = [0] * (n + 1)

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

ans = sum(di <= x for di in d)
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:
N,X=map(int,input().split())
L=list(map(int,input().split()))

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

print(cc)

Submission status: Accepted

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

ans = 1
d = 0

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

Submission status: Accepted

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

  
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, limit = map(int, input().split())
bounce = input().split()
b = [0]
count = 0
for i in range(len(bounce)):
  b.append(b[i]+int(bounce[i]))
  
for j in range(len(b)):
  if b[j] <= limit:
    count += 1
print(count)

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

list2 = []
t,count = 0,0
for i in range(N):
    t += int(list1[i])
    list2.append(t)

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

print(int(count) + 1)

Submission status: Accepted

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

d = 0
i = 0
while(i < n):
    d = d + l[i]
    if d > x:
        break
    i += 1
print(i + 1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, X = map(int, input().split())
n = 0
ret = 1
for x in [int(x) for x in input().split()]:
    n += x
    if n > X:
        break
    ret += 1
print(ret)

Submission status: Accepted

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

pos = 0
cnt = 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n, x = map(int, input().split())
l = list(map(int, input().split()))
cnt = 1
d = 0
for l_i in l:
    d += l_i
    cnt += (d <= x)
print(cnt)

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 += l[i]
    if bound <= X:
        ans += 1
    else:
        break
print(ans)

Submission status: Accepted

Solution code:
N,X= map(int,input().split())
L_list = list(map(int,input().split()))
#N = int(input())
D = [0]*(N+1)
for i in range(N):
    D[i+1] = D[i]+L_list[i]
import bisect
n = bisect.bisect_right(D, X)
print(n)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

print(count)

Submission status: Accepted

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

length = 0
count = 1
for i in range(n):
  
  length += lis[i]
  if length <= x:
    count +=1
    
print(count)

Submission status: Accepted

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

I = 0
A = 1
for i in L:
  I+=i
  if I <= X:
    A += 1
print(A)

Submission status: Accepted

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

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

for i in range(N):
    D.append(D[i]+L[i])

for i in D:
    if(X>=i):
        count=count+1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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

for i,l in enumerate(L):
    z = z+l
    if z>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()))
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())
bound_list = list(map(int,input().split()))
bound_list.insert(0,0)
bound = 0
count = 0

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

print(count)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
c = map(int, input().split())
p, count = 0, 1
for t in c:
  p = p + t
  if (p <= b):
    count = count + 1
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
count = 0
for i in range(N + 1):
	count += 1
	if i < N:
		D = D + L[i]
	if D > X:
		break

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve():
    N, X = [int(s) for s in input().split() if s]
    L = [int(s) for s in input().split() if s]
    D = 0
    cnt = 0
    for l in L:
        # print(D)
        D += l
        cnt += 1
        if D > X:
            return cnt
    return cnt+1

print(solve())

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 range(N):
  now += L_list[i]
  if now <= X:
    count += 1
  else:
    break

print(count)

Submission status: Accepted

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

ans = 1
D_i = 0
for i in L:
  D_i += i
  if D_i <= X:
    ans += 1

print(ans)

Submission status: Accepted

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

import numpy as np


def solv(x, l_):
    ok = np.add.accumulate(l_) <= x
    return np.count_nonzero(ok) + 1


if __name__ == '__main__':

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

    l_ = np.fromstring(input(), dtype=np.uint16, sep=' ')

    ans = solv(x, l_)

    print(ans)

Submission status: Accepted

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

c = 0

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

Submission status: Accepted

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

c = 0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,m = map(int,input().split())
lis = list(map(int,input().split()))
ans = 1
now = 0
for num in lis:
  now += num
  if now > m:
    break
  else:
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
goukei=0 
count=1

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, x = list(map(int, input().split()))
a = list(map(int, input().split()))
for i in range(1, n):
  a[i] += a[i - 1]
  if a[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())))

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

print(cnt)

Submission status: Accepted

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

D = [0]

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

flag = True
for i in range(len(D)):
    if D[i] > X:
        print(i)
        flag = False
        break

if flag:
    print(N+1)

Submission status: Accepted

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


def main():
    n, x = map(int, input().split())
    lst = list(map(int,input().split()))
    lst = lst[:n]

    d = []
    for i in range(n + 1):
        if i == 0:
            d.append(0)
        else:
            d.append(d[i - 1] + int(lst[i - 1]))

    bound = 0

    for n, i in enumerate(d):
        if i <= x:
            bound += 1
        else:
            break
    print(bound)


if __name__ == '__main__':
    main()

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

cnt = 0
for j in range(len(L)):
    if L[j] <= x:
        cnt+=1
    else:
        break

print(cnt+1)

Submission status: Accepted

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


if __name__ == "__main__":
    main()