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

Submission status: Accepted

Solution code:

n,x = map(int, input().split())
a = list(map(int, input().split()))
cnt = 1
total = 0

for i in range(n):
    total += a[i]
    if total <= x:
        cnt += 1
print(cnt)

Submission status: Accepted

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

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

d=0
count=1
for i in range(n):
    d=d+l_list[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()))

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

Submission status: Accepted

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

Submission status: Accepted

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

cnt = 1
z = 0

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

Submission status: Accepted

Solution code:
n,x=map(int,input().split())
ans=1
p=0
l=[int(x) for x in input().split()]
for i in range(n):
    p+=l[i]
    if p > 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()))
ans = 0
ct = 1
for i in range(N):
    ans += L_List[i]
    if ans <= X:
        ct += 1
    else:
        break
        
print(ct)

Submission status: Accepted

Solution code:
import itertools
import bisect

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

dl = [0] + list(itertools.accumulate(ll))

print(bisect.bisect_right(dl, x))

Submission status: Accepted

Solution code:
r=input().split()
N=int(r[0])
X=int(r[1])
d=[int(s) for s in input().split()]
ans=1
le=0
for i in range(N):
    le+=d[i]
    if le>X:
        print(ans)
        break
    elif i==N-1:
        print(N+1)
    else:
        ans+=1

Submission status: Accepted

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

ans = 1
D = 0
for i in li:
    D += i
    if D <= x:ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# Di = Di-1 + Li-1
n, x = map(int, input().split())
L = list(map(int, input().split()))
ans = 0
ct = 1 
for i in range(n):
    ans = ans + L[i]
    if ans > x:
        break
    else:
        ct += 1
print(ct)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict


def mapt(fn, *args):
    return tuple(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))


def main():
    n, x = Input()
    l = Input()
    d = defaultdict(int)
    d[0] = 0
    ans = 0

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

    for i in d.values():
        if i <= x: ans += 1

    print(ans)

main()

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for l in L:
    val += l
    if val <= 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(N):
  d += L[i]
  if d > X:
    break
  c += 1
print(c)

Submission status: Accepted

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

    for cnt in range(2, N + 2):
        D += L[cnt - 2]
        if D > X:
            cnt -= 1
            break

    print(cnt)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり

N,X = MI()
L = LI()

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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(0,N):
  D.append(D[i]+L[i])

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

Submission status: Accepted

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

sumList = [0]
for i in range(n):
    s = sumList[i]+l[i]
    if s > X:
        break
    sumList.append(s)

print(len(sumList))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, x = map(int, input().split())
L = list(map(int, input().split()))
dist = 0
res = 0
for i, l in enumerate(L, 1):
    dist += l
    if dist > x:
        print(i)
        exit()
    elif dist == x:
        print(i + 1)
        exit()
print(n + 1)

Submission status: Accepted

Solution code:
from itertools import accumulate
from bisect import *
N, X = map(int, input().split())
L = list(tuple(map(int, input().split())))

acc = sorted(list(accumulate(L)) + [0])

n = bisect_right(acc,X)
print(n)

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import bisect
from itertools import accumulate
N, X = map(int, input().split())
L = list(map(int, input().split()))
Lsum = list(accumulate(L))
ind = bisect.bisect_right(Lsum, X)
print(ind+1)

Submission status: Accepted

Solution code:
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


INF = float('inf')


n, x = LI()
l = LI()
cnt = 1
d = 0
for i in range(n):
    # print(f'{(d, l[i])=}')
    if d + l[i] <= x:
        cnt += 1
        d += l[i]
    else:
        break
print(cnt)

Submission status: Accepted

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

a = 0
count = 1
for i in l:
    a += i
    if a <= x:
        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
for i in range(N) :
    D = L[i]+D
 #   print(i,D)
    if D>X :
        print(i+1)
        exit()

print(N+1)

Submission status: Accepted

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

ans=1
d=0

for i in a:
  d+=i
  if d>x:
    break
  ans+=1
  
print(ans)

Submission status: Accepted

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

jump_point = [0]
tmp = 0
for point in list:
    tmp += point
    jump_point.append(tmp)

ans = 0
for i in jump_point:
    if i <= x:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
n, x = map(int, input().split())
l = list(map(int, input().split()))
xlist = [0]
num = 0
for i in l:
    num += i
    xlist.append(num)
cnt = 0
for j in xlist:
    if j <= x:
        cnt += 1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,x=[int(x) for x in input().split()]
l=[int(x) for x in 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:
# coding = SJIS
n, x = map(int, input().split())
lis = list(map(int, input().split()))
ans = 0

bou = [0]
for i in range(n):
    bou.append(bou[i] + lis[i])

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

print(ans)

Submission status: Accepted

Solution code:
import itertools
import bisect

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

A = list(itertools.accumulate(L))
print(bisect.bisect(A, X) + 1)

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:
from itertools import accumulate

n, x = map(int, input().split())
L = list(map(int, input().split()))
C = [0] + list(accumulate(L))
#print(C)

cnt = 0
for c in C:
    if c <= x:
        cnt += 1
print(cnt)

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

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

D = 0
ans = 1

for i in range(N):
    D += Ls[i]
    if D <= 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()))
from itertools import accumulate
l=[0]+list(accumulate(l))


from bisect import bisect_right
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(1,n+1):
    d=d+l[i-1]
    if d<=x:
        cnt+=1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

count = 1

d = 0

for x  in l:
    d = d + x

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

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
  else:
    break

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

dis = 0
cnt = 1

for L in map(int, input().split()):
    dis += L
    cnt += dis <= X

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
L = list(map(int, input().split()))
x = [0]
y = 0
z = 0
for i in range(a):
  y = y + L[i]
  x.append(y)
for j in range(len(x)):
  if x[j] <= b:
    z = z+1
print(z)

Submission status: Accepted

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

c=1
suml=0
for i in range(n):
    if x>=L[i]+suml :
        c+=1
        suml+=L[i]
    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(1,n+1):
    d.append(d[i-1]+l[i-1])

ans = 0

for dd in d:
    if dd <= x:
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate, product # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
# my_round_int = lambda x:np.round((x*2 + 1)//2)
# 四捨五入g
import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
n,x = readInts()
L = readInts() + [0]
cnt = 0
now = 0
for i in range(n+1):
    if now <= x:
        cnt += 1
        now += L[i]
    else:
        break
print(cnt)

Submission status: Accepted

Solution code:
from itertools import accumulate

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

a = accumulate(L)

for key, i in enumerate(a):
    if i > X:
        print(key+1)
        exit()

print(N+1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n,x = map(int, input().split())
ll = list(map(int, input().split()))
cnt = 1
v = 0
for l in ll:
    v += l
    if v > x:
        break
    else:
        cnt += 1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    N, X = (int(i) for i in input().split())
    L = [int(i) for i in input().split()]
    from itertools import accumulate
    S = list(accumulate([0] + L))
    ans = 0
    for s in S:
        if X < s:
            break
        ans += 1
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inl = lambda: [int(x) for x in sys.stdin.readline().split()]
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))


def solve():
    N, X = inl()
    L = inl()
    cnt = 1
    d = 0
    for i in range(N):
        d += L[i]
        if d > X:
            break
        cnt += 1

    return cnt


print(solve())

Submission status: Accepted

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

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

print(sum(1 for li in lis if li <= x ))

Submission status: Accepted

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

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 = list(map(int, input().split()))
L = list(map(int, input().split()))
ans = 1
d = 0
for i in range(N):
	tmp = d + L[i]
	if tmp <= X:
		ans += 1
	d = tmp
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()))
sum_list = [sum(L[:i]) for i in range(N+1)] 
count = 0
for i in sum_list:
    if i <= 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(1,n+1):
    temp=d[i-1]+l[i-1]
    if temp>x:
        ans=i
        break
    d.append(temp)

else:
    ans=n+1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

c = 1
y = 0

for m in l:
    if y + m <= x:
        c += 1
        y += m
    else:
        break

print(c)

Submission status: Accepted

Solution code:
def main():
    n, x = map(int, input().split())
    l_lst = list(map(int, input().split()))
    count = 0
    coordinate_lst = [0]

    for i in range(n):
        coordinate_lst.append(coordinate_lst[i] + l_lst[i])

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

    print(count)


if __name__ == '__main__':
    main()

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

from functools import reduce

def solve(X, Ls):
  return len(list(filter(
    lambda x: x <= X, reduce(lambda x, y: x + [x[-1] + y], Ls, [0]))))


if __name__ == '__main__':
  _, X = map(int, input().split())
  print(solve(X, map(int, input().split())))

Submission status: Accepted

Solution code:
# coding: utf-8

def solve(X, Ls):
  c, s = 0, 0
  for L in Ls:
    s += L
    if s > X:
      break
    c += 1
  return c + 1


if __name__ == '__main__':
  _, X = map(int, input().split())
  print(solve(X, map(int, input().split())))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from itertools import accumulate
from bisect import *
N, X = map(int, input().split())
L = list(map(int, input().split()))
S = list(accumulate([0]+L))
print(bisect_right(S,X))

Submission status: Accepted

Solution code:
n, x = list(map(int, input().split()))
l = list(map(int, input().split()))
d = [0]
for i in range(len(l)):
    d.append(d[i] + l[i])
print(len(list(filter(lambda d_i: d_i <= x, d))))

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_ls = map(int, input().split(' '))
D, cnt = 0, 1
for L in L_ls:
    D += L
    if D > X:
        break
    cnt += 1
print(cnt)

Submission status: Accepted

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

N, X = LI()
L = LI()


def main():
    ans = 1
    d = 0
    for l in L:
        d += l
        if d > X:
            break
        ans += 1
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

i = 0
s = 0
while(s <= X and i < len(L)):
  s += L[i]
  i += 1

if s <= X:
  i += 1

print(i)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# 問題：https://atcoder.jp/contests/abc126/tasks/abc130_b

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

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

print(i+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, x = map(int, input().split())
l = list(map(int, input().split()))
# ボールが跳ねる座標の数列を作成する。
# 初期値は、0である。
d = [0]
for i in range(n):
    d.append(d[i]+l[i])
a = 0
for dd in d:
  	# ボールが何回、跳ねるかどうか？
    # X座標以下である座標は跳ねるので、カウントする。
    if dd <= x:
        a += 1
print(a)

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])
a = 0
for dd in d:
    if dd <= x:
        a += 1
print(a)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from bisect import bisect_right

n, x = map(int, input().split())
L = list(map(int, input().split()))
D = [0]
for i in range(n):
    D += [L[i] + D[i]]
ans = bisect_right(D, x)
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):
    D += [L[i] + D[i]]
ans = 0
for d in D:
    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()))

cnt = 1
d = 0
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()))

jump = [0]
num = 0
for i in range(N):
    num += L[i]
    jump.append(num)

ans = 0
for i in jump:
    if i <= X:
        ans += 1
print(ans)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]


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

temp = []

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

Submission status: Accepted

Solution code:
NN = input().split()
N = int(NN[0])
X = int(NN[1])
LL = input().split()
list1 = [0]
for i in range(N):
  
  a = list1[i] + int(LL[i])
  list1.append(a)
count = 0
for i in list1:
  if int(i) <= X:
    count +=1
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N, X = [int(n) for n in input().split()]
l = [int(n) for n in input().split()]

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

#print(D)

count = 0
for n in D:
    if n <= X:
        count += 1
    else:
        break

print(count)

Submission status: Accepted

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

print(count)

Submission status: Accepted

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

print(counter)

Submission status: Accepted

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

D = 0
for i in range(len(L)) :
  D += L[i]
  if D > X:
    print(i+1)
    exit()

print(len(L)+1)