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

Submission status: Accepted

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

for i in l:
  y = y + i
  if y <= x:
    ans = ans + 1

print(ans)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    n,x=INTM()
    l=LIST()
    ct=1
    temp=0
    for i in range(n):
        temp+=l[i]
        if temp<=x:
            ct+=1
        else:
            break
    print(ct)
if __name__ == '__main__':
    do()

Submission status: Accepted

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

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):
  point += l[i]
  if point <= x:
    count += 1
  else:
    break

print(count)

Submission status: Accepted

Solution code:
import sys

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

for i in range(n):
    if sum(l_list[:i+1]) > x:
        print(i+1)
        sys.exit()

print(n+1)

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

Submission status: Accepted

Solution code:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

D=0
count=1
while D<=X and count<=N+1:
    if count != N+1:
       D=D+L[count-1] #count kaime no jump
    count+=1

print(count-1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

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

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

print(min(ans, n + 1))

Submission status: Accepted

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

d = [0]*(n+1)
d[0] = 0
for i in range(1,n+1):
    d[i] = d[i-1] +L[i-1]

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

Submission status: Accepted

Solution code:
N,X = map(int,input().split())
L = 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()))

count = 1
p = 0

for l_i in l:
    p += l_i
    if p <= x:
        count += 1
    else:
        break

print(count)

Submission status: Accepted

Solution code:
N,X = map(int,input().split())
L = list(map(int,input().split()))
h = 0
ans = 1
for i in L:
    h += i
    if h <= 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)

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

print(cnt + 1)

Submission status: Accepted

Solution code:
import bisect
N,X=map(int,input().split())
L=list(map(int,input().split()))
for i in range(N-1):L[i+1]+=L[i]
print(bisect.bisect_left(L,X+1)+1)

Submission status: Accepted

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

for i in range(n):
    curr=prev+l[i]
    if curr<=x:
        ans+=1
    prev=curr
print(ans)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

tmp = 0
cnt = 1

for i in range(N):
    tmp += L[i]

    if(tmp <= X):
        cnt += 1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

    if d <= x:
        num = num + 1

print(num)

Submission status: Accepted

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

for i in L:
    D += i
    if D<=X:
        cnt += 1

print(min(N+1, cnt))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# from math import factorial,sqrt
# from itertools import permutations as permus
# from fractions import gcd
# from collections import deque,Counter
# from decimal import Decimal, getcontext
# # getcontext().prec = 1000
# # eps = Decimal(10) ** (-100)

# import numpy as np
# import scipy as scp

# 入力の受け取り
n,x = map(int,input().split())
# 配列入力の受け取り
arrL = list(map(int,input().split()))

ans = [0]
junpzahyou = 0
i = 1
for i in arrL:
    junpzahyou += i
    if junpzahyou <= x:
        ans += [junpzahyou]
    else:
        continue

print(len(ans))
# print("{:.10f}".format(ans))
# print(*ans)   # unpackして出力。間にスペースが入る
# for row in board:
#     print(*row,sep="")    #unpackして間にスペース入れずに出力する

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,x = map(int,input().split())
li = list(map(int,input().split()))
count = 1
kyori = 0
for i in li:
  kyori = kyori + i
  count += 1
  if kyori > x:
    count -=1
    break
print(count)

Submission status: Accepted

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

point, cnt = 0, 1
for i in range(n):
    point += l[i]
    if point>x:
        break
    cnt += 1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
f=lambda:map(int,input().split())
_,x=f();c,d=1,0
for i in f():
  d+=i
  if d<=x:c+=1
print(c)

Submission status: Accepted

Solution code:
f=lambda:map(int,input().split())
_,x=f();c,d=1,0
for i in f():
  d+=i
  if d>x: break
  c+=1
print(c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from bisect import *
from heapq import *
from collections import *
from itertools import *
from functools import *
from math import *

sys.setrecursionlimit(100000000)
input = lambda: sys.stdin.readline().rstrip()

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

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

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

e = 1


for i in L:
    if d + i <= X:
        d += i
        e += 1
    else:
        break

# for i in l:
print(e)

Submission status: Accepted

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

Submission status: Accepted

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

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

tmp = 0
for i in range(n):
    tmp += l_list[i]
    if tmp > x:
        break

if tmp <= x:
    print(101)
else:
    print(i+1)

Submission status: Accepted

Solution code:
def solve():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    l = [0]
    d = 0
    for a in A:
        d += a
        l.append(d)
    c = 0
    for a in l:
        if a <= M:
            c += 1

    return c

print(solve())

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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


ans = bisect.bisect_right(x,k)
print(ans)

Submission status: Accepted

Solution code:
n,x = map(int,raw_input().split())
l = map(int,raw_input().split())
d1=0
bou = 1
for i in xrange(n):
    d1 += l[i]
    
     
    if d1 > x:
        break
    else:
        bou += 1
print bou

Submission status: Accepted

Solution code:
import itertools
N , M = (map(int , input().split()))
A = list(map(int , input().split()))
A.insert(0,0)
cumsum = list(itertools.accumulate(A))
count = 0
for i in cumsum:
    if i <= M:
        count += 1
print(count)

Submission status: Accepted

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

N,X = list(map(int, input().rstrip().split()))
L_list = list(map(int, input().rstrip().split()))
#-----

D=0
ans = len(L_list) + 1

cnt=1
for i in range(N):
    D = D + L_list[i]
    
    if D <= X:
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
N,X = map(int,input().split())
L = [int(i) for i in input().split()]
#print(L)
cnt=0
D = [0]
for i in range(N):
  tmp = D[i]+L[i]
  D.append(tmp)
  if tmp <= X:
    cnt += 1
print(cnt+1)
#初期値の0を追加

Submission status: Accepted

Solution code:
import sys
import numpy as np

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N, X = lr()
L = np.array([0] + lr())
Lcum = L.cumsum()
i = np.searchsorted(Lcum, X, side='right')
print(i)
#

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, x, *l = map(int, open(0).read().split())
s, c = 0, 0
for i in l:
    s += i
    c += 1
    if s > x:
        print(c)
        exit()
print(n + 1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

n,x = map(int,input().split())
b = list(map(int,input().split()))
cnt = 0
ans = 1
for i in b:
    cnt += i
    if cnt <= x:
        ans += 1

print(ans)

Submission status: Accepted

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

count = 1
D = 0
for i in range(N):
    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()))
cnt = 1
di = 0

for li in L:
    di += li
    if di > X:
        break
    cnt += 1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import numpy as np


def main():
    n, x = map(int, input().split())
    ls = np.array(list(map(int, input().split())))
    ans = 1
    h = 0
    for l in ls:
        h += l
        if h <= x:
            ans += 1
        else:
            break
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

ans = 1
tmp = 0
for i in l:
    tmp += i
    if(tmp > x):
        break
    ans += 1
print(ans)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
def getint():
    a = input().split()
    for i in range(len(a)):
        a[i] = int(a[i])
    return a

num,lim = getint()
l = getint()
sumup = 0
k = True
for i in range(num):
    sumup = sumup + l[i]
    if sumup > lim:
        print(i+1)
        k = False
        break
if k ==True:
    print(num+1)

Submission status: Accepted

Solution code:
miis=lambda:map(int,input().split())
lmiis=lambda:list(map(int,input().split()))

n,x=miis()
l=lmiis()

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

num = 0
ans = 1

for i in range(n):
    num += li[i]
    if num <= x:
        ans += 1

print(ans)

Submission status: Accepted

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

d = 0
ans = 1
for li in l:
    d += li
    if d > x:
        break
    ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, x = map(int, input().split())
a = [ int(x) for x in input().split() ]
cnt = 1
s = 0
for aa in a:
    s += aa
    if s <= x:
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
#ABC130

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

Submission status: Accepted

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

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

Submission status: Accepted

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

import sys

DEBUG = False

def solve():
    return


def read_int_list(sep = " "):
    return [int(s) for s in sys.stdin.readline().rstrip().split(sep)]

def read_int():
    return int(sys.stdin.readline())

def dprint(*args, **kwargs):
    if DEBUG:
        print(*args, **kwargs)
    return


def main():
    _, x = read_int_list()
    ls = read_int_list()

    ans = 1
    p = 0
    for l in ls:
        if p + l > x:
            break
        p += l
        ans += 1
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

num = 0
ans = 1

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

print(ans)

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

Solution code:
#import sys
#import math
#import numpy as np
'''a,b= map(int,input().split())'''
#a, b, c = [list(map(int, input().split())) for _ in range(3)]
#li0= [int(x) for x in input().split()]
n,l= map(int, input().split())
#x = [list(map(int, input().split())) for _ in range(n)] 
li0= [int(x) for x in input().split()]
ans=1
count=0
for i in li0:
  count+=i
  if count<=l:
    ans+=1
  else:
    break
print(ans)

Submission status: Accepted

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


d = 0
count = 0
if d <= x:
    count += 1

    
for i in range(n):
    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, ]
for i in range(n):
    D.append(D[i] + L[i])
print([D[i] <= x for i in range(n+1)].count(True))

Submission status: Accepted

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

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

print(ans)

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 = [int(x) for x in 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:
from sys import stdin

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

Submission status: Accepted

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

sumL = 0
count = 0

for x in range(len(L) + 1):
    if sumL <= X:
        count += 1
    if x != len(L):
        sumL += L[x]
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

za = 0


for count in range(N):
  za += L[count]
  if za > X:
    break

else:
  count += 1
  
print(count+1)

Submission status: Accepted

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

L = list(map(int, input().split()))
current = 0
ans = 1  # 最初は地点0で跳ねるから
for l in L:
    current += l
    if current <= X:
        ans += 1
print(ans)

Submission status: Accepted

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

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

print(sum([d[i]<=x for i in range(n+1)]))

Submission status: Accepted

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

pos = 0
cnt = 1

for i in range(N):
    pos += l[i]

    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()))
sum1 = 0
cnt = 1
for i in L:
  sum1 += i
  if sum1 <= x:
    cnt += 1
  else:
    break
print(cnt)

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

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

cusum = [0]*(n+1)
for i in range(n):
    cusum[i+1] += cusum[i]+l[i]

print(bisect.bisect_right(cusum, x))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 1
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()))
cumlate = [0]*(n+1)
for i in range(n):
    cumlate[i+1] = cumlate[i] + l[i]
    if x < cumlate[i+1]:
        print(i+1)
        exit()
else:
    print(n+1)

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)
        break
else:
    print(n+1)

Submission status: Accepted

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

x = 0
cnt = 0
for l in L:
    x += l
    if x > X:
        break
    else:
        cnt += 1

print(cnt+1)

Submission status: Accepted

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

Submission status: Accepted

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

s = 1
d = 0
for i in l:
  d += i
  if d <= x:
    s += 1
print(s)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def main():
    N, X = map(int, input().split())
    L = [int(v) for v in 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)
            exit()

    print(N+1)


main()

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
class Solution:
    def solve(self, N: int, X: int, L) -> str:

        count = 1
        distance = 0

        for l in L:
            distance += l
            if distance > X:
                break

            count += 1

        return count


if __name__ == '__main__':

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

    # solve
    solution = Solution()
    print(solution.solve(N, X, L))