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 = [int(c) for c in input().split()]
L = [int(c) for c in input().split()]
n=1
D=0
for l in L:
    D+=l
    if D>X: break
    n+=1

print(n)

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

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

ans = 1
d = 0
for l in L_array:
    d += l
    if d <= X:
        ans += 1
    else:
        break

print(ans)

Submission status: Accepted

Solution code:
def main():
    n, x = (int(z) for z in input().split())
    els = [int(el) for el in input().split()]
    ds = [0] * (n + 1)
    for i in range(1, n + 1):
        ds[i] = ds[i - 1] + els[i - 1]
    res = sum(d <= x for d in ds)
    print(res)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
from sys import stdin
import numpy as np
N,X = [int(x) for x in stdin.readline().rstrip().split()]
data = [0] + [int(x) for x in stdin.readline().rstrip().split()]
res = np.cumsum(data)
print(len(res[res<=X]))

Submission status: Accepted

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

ans = 1

start = 0

for l in L:
    start = start + l
    if start <= X:
        ans += 1
    else:
        break

print(ans)

Submission status: Accepted

Solution code:
import sys

ns = lambda: sys.stdin.readline().rstrip()
ni = lambda: int(ns())
nm = lambda: map(int, sys.stdin.readline().split())
nl = lambda: list(nm())
nsm = lambda: map(str, sys.stdin.readline().split())
nsl = lambda: list(nsm())

n, x = nm()
l = nl()
for i in range(n - 1):
    l[i + 1] += l[i]
cnt = 1
for j in range(n):
    if l[j] <= x:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
import sys
from operator import itemgetter
from collections import deque

input = sys.stdin.readline

N, X = map(int, input().split())
L = list(map(int, input().split()))
L2 = [0]
for i in range(len(L)):
    L2.append(L2[i] + L[i])

counter = 0
for i in range(len(L2)):
    if L2[i] <= X:
        counter += 1
print(counter)

Submission status: Accepted

Solution code:
#!/usr/bin/python3
# -*- coding: utf-8 -*-


N,X = map(int, input().split())
Ln = [0] + list(map(int, input().split())) + [X+1]

csum = 0
ans = 0
for i,l in enumerate(Ln):
  if csum<=X and csum+l>X:
    ans = i
  csum += l
print(ans)

Submission status: Accepted

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

L_cum = [0] * (N+1)
flag = 0
for i in range(N):
    L_cum[i+1] = L_cum[i] + L[i]
    if L_cum[i+1] > X:
        ans = i + 1
        flag = 1
        break
if flag == 1:
    print(ans)
else:
    print(N+1)

Submission status: Accepted

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

di = 0
cnt = 1
for li in ln:
  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()))

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 = (int(i) for i in input().split())
bound = list(int(i) for i in input().split()) 
 
now=0
kosu=0
for b in bound:
    if now<=x:
        kosu+=1
    now+=b

if now<=x:
    kosu+=1
print(kosu)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline



def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N, X] = [int(input_raw[0]), int(input_raw[1])]
    input_raw = read_func().strip().split()
    L = [int(input_raw[i]) for i in range(N)]
    D = 0
    ans = 1
    for i in range(N):
        D = D + L[i]
        if D <= X:
            ans += 1
    print ans
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a,b=input().split()
a=int(a)
b=int(b)
c=input().split()
c=[int(i) for i in c]
count=1
distance=0
for i in c:
    distance+=i
    if distance>b:
        break
    count+=1
print(count)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

cnt = 1
d = 0
for l in L:
    d += l
    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
for i, li in enumerate(l):
    d += li
    if d > x:
        print(i + 1)
        break
else:
    print(n + 1)

Submission status: Accepted

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


def solve():
    N, X = list(map(int, input().split()))
    L = list(map(int, input().split()))
    count = 1
    bounding = 0
    for l in L:
        bounding += l
        if bounding > X:
            break
        count += 1
    return count


def main():
    print(solve())


if __name__ == "__main__":
    main()

Submission status: Accepted

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

    if count <= X:
        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
cnt = 1
for l in L:
	D += l
	if D<=X:
		cnt += 1
	else:
		break

print(cnt)

Submission status: Accepted

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

print(len([1 for l in L if l <= X]))

Submission status: Accepted

Solution code:
def main():
    bounces = 1
    n,x = map(int,input().split())
    L = list(map(int,input().split()))
    d = 0
    for i in range(1,n+1):
        d += L[i-1]
        if d > x:
            break
        bounces += 1

    print(bounces)

main()

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(X >= D):
        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):
    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())
Ls = list(map(int, input().split()))

D = 0
ans = 1
for L in Ls:
    D += L
    if D <= X:
        ans += 1
    else:
        break

print(ans)

Submission status: Accepted

Solution code:
n, x = [ int(v) for v in input().split() ]
bound_list = [ int(v) for v in input().split() ]
ball_pos_list = [ 0 for i in range(n+1)]
for i in range(n):
    ball_pos_list[i+1] = ball_pos_list[i] + bound_list[i]
ball_pos_list = [ i for i in ball_pos_list if i <= x]
print(len(ball_pos_list))

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 += 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()))
p = 0
cnt = 1
i = 0
while i < N:
    p += L[i]
    if p <= X:
        cnt += 1
    else:
        break
    i += 1
print(cnt)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(res)

Submission status: Accepted

Solution code:
###template###
import sys
def input(): return sys.stdin.readline().rstrip()
def mi(): return map(int, input().split())
###template###

N,X = mi()

Ls = list(mi())

ichi = 0
ans = 1
for l in Ls:
  ichi += l
  if ichi <= X: ans += 1
  else: break

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import random
input = sys.stdin.readline

##### リストの 二分木検索 #####
# bisect_left(lists, 3)
# bisect_right(lists, 3)

##### プライオリティキュー #####
# heapq.heapify(a) #リストaのheap化
# heapq.heappush(a,x) #heap化されたリストaに要素xを追加
# heapq.heappop(a) #heap化されたリストaから最小値を削除＆その最小値を出力

# heapq.heappush(a, -x) #最大値を取り出す時は、pushする時にマイナスにして入れよう
# heapq.heappop(a) * (-1) #取り出す時は、-1を掛けて取り出すこと

##### タプルリストのソート #####
# sorted(ans) #(a, b) -> 1st : aの昇順, 2nd : bの昇順
# sorted(SP, key=lambda x:(x[0],-x[1])) #(a, b) -> 1st : aの昇順, 2nd : bの降順
# sorted(SP, key=lambda x:(-x[0],x[1])) #(a, b) -> 1st : aの降順, 2nd : bの昇順
# sorted(SP, key=lambda x:(-x[0],-x[1])) #(a, b) -> 1st : aの降順, 2nd : bの降順

# sorted(SP, key=lambda x:(x[1])) #(a, b) -> 1st : bの昇順
# sorted(SP, key=lambda x:(-x[1])) #(a, b) -> 1st : bの降順

def main():

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

	ans = 1
	to = 0

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

Submission status: Accepted

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

D=[0]*10000
c= 1
for n in range(1,len(L)+1):
    D[n] = D[n-1]+L[n-1]
    if D[n] <= X:
        c+=1
print(c)

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

cnt = 1
position = 0
for i in range(min(len(L), N)):
    distance = L[i]
    position += distance
    if position <= X:
        cnt += 1
        continue
    else:
        break

print(cnt)

Submission status: Accepted

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

pos = 0
count = 1
for i in range(n):
    pos += l[i]
    if pos <= x:
        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()]
cnt = 0
x = 0
for ind,i in enumerate(L):
    cnt+=1
    x+=i
    if(x>X):
        break
    if(ind==N-1):
        cnt+=1
print(cnt)

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 = D[i]
    l = L[i]
    D.append(d+l)
print(len([i for i in D if i <= x]))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
NX = list(map(int,input().split()))
N = NX[0]
X = NX[1]

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

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

print(output)

Submission status: Accepted

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

D = 0

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

Submission status: Accepted

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

index=0
current = 0
count = 0
while index < len(listL):
    if current <= x:
        count+=1
    current += listL[index]
    index+=1
if current <= x:
    count+=1
print(count)

Submission status: Accepted

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

zahyou = 0
cnt = 1
for i in range(n):
    zahyou += l[i]
    if zahyou <= 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 = 0
for i in range(N):
  if D<=X:
    count = count+1
  D = D+L[i]
if D<=X:
  count = count+1

print(count)

Submission status: Accepted

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

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N,X=MAP()
L=LIST()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

def read_input():
    n, x = map(int, input().split())
    ls = [0] + list(map(int, input().split()))
    return n, x, ls


def submit():
    n, x, ls = read_input()

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

    print(count)


if __name__ == '__main__':
    submit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:

def main():
    buf = input()
    buflist = buf.split()
    N = int(buflist[0])
    X = int(buflist[1])
    buf = input()
    buflist = buf.split()
    L = list(map(int, buflist))
    bound = [0]
    for i in range(N):
        bound.append(bound[-1] + L[i])
    for i, x in enumerate(bound):
        if x > X:
            print(i)
            return
    print(N+1)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python
n, x = map(int, input().split())
L = [int(i) for i in input().split()]

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

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):
        break
    ans+=1
print(ans)

Submission status: Accepted

Solution code:
def main():
    N, X = [int(val) for val in input().split()]
    ball_place = 0
    input_line = [int(val) for val in input().split()]
    assert len(input_line) == N
    bounded_num = 1
    for diff in input_line:
        ball_place += diff
        if ball_place <= X:
            bounded_num += 1
        else:
            break
    print(bounded_num)


if __name__ == '__main__':
    main()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, X = map(int, input().split())
A = [int(a) for a in input().split()]
x = 0
c = 0
i = 0
while x <= X:
    c += 1
    if i == N:
        break
    x += A[i]
    i += 1
print(c)

Submission status: Accepted

Solution code:
def makelist(n, m):
    return [[0 for _ in range(m)] for _ in range(n)]


N, X = map(int, input().split())
L = [0] + list(map(int, input().split()))

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# coding: utf-8
import re
import bisect
from datetime import datetime as dt
import bisect
import math

def gcd(a, b):
    return math.gcd(a, b)

def lcm(a, b):
    return a * b / gcd(a, b)

class slist(list):
    def __init__(self, *args, **kw):
        list.__init__(self, *args, **kw)
        self.sort()

    def append(self, value):
        bisect.insort(self,value)

    def index_left(self, value):
        return bisect.bisect_left(self, value)


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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
for i in D[1:]:
    if i <= X:
        ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

count = 0
d = 0
if d <= x:
    count += 1
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(' '))
result = 1
tmp = 0
a = list(map(int, input().split(' ')))
for i in a:
    tmp += i
    if tmp <= x:
        result += 1
print(result)

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

Submission status: Accepted

Solution code:
from itertools import accumulate

N,X = [int(i) for i in input().split()]
L = [int(i) for i in input().split()]
L = [0] + L
L = list(accumulate(L))

ans = 0
for i in range(len(L)):
    if X < L[i]:
        ans = i
        print(ans)
        exit()

print(N+1)

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

Submission status: Accepted

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

res = 1
d = 0
for li in L:
    d += li
    if d <= X:
        res += 1

print(res)

Submission status: Accepted

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

jump = 1
now = 0
for l in ll:
    if now + l <= x:
        jump+= 1
        now += l
    else:
        break
print(jump)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
from functools import reduce
from collections import deque
import sys
sys.setrecursionlimit(10**7)

def s(generator, splitter, mapper):
    return [ mapper(s) for s in generator().split(splitter) ]

# スペース区切りの入力を読み込んで数値リストにして返します。
def get_nums_l():
    return [ int(s) for s in input().split(" ")]

# 改行区切りの入力をn行読み込んで数値リストにして返します。
def get_nums_n(n):
    return [ int(input()) for _ in range(n)]

n,x = get_nums_l()
nums = get_nums_l()

now = 0
ans = 1
for n in nums:
    now += n
    if now <= x:
        ans += 1
    else:
        break

print(ans)

Submission status: Accepted

Solution code:
import sys
def input():
    return sys.stdin.readline()[:-1]

def main():
    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)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

D = 0
b_count = 1
for L in L_arr:
    D += L
    if D > X:
        break
    b_count += 1

print(b_count)

Submission status: Accepted

Solution code:

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

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

ans = 1
now = 0
for i in L:

    now += i

    if now > X:
        break

    else:
        ans += 1

print (ans)

Submission status: Accepted

Solution code:
import sys, itertools, collections
sys.setrecursionlimit(10**7)
def lmi(): return list(map(int, input().split()))

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

print(c)

Submission status: Accepted

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

Submission status: Accepted

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

cur = 0
count = 1
for i in L:
  cur += i
  if cur <= X:
    count += 1
  else:
    break

print(count)

Submission status: Accepted

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

count = 0
d = 0
i = 0
while d <= X:
	count += 1
	if i >= len(l_list):
		break
	d += l_list[i]
	i += 1
print(count)

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

t = 0

ans = 1

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

Submission status: Accepted

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

l = [int(y) for y in input().split()]

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

print(c)

Submission status: Accepted

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

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

print(c)

Submission status: Accepted

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

ans = 1
count = 0
for i in L:
    count += i
    if count <= X:
        ans +=1
    else:
        break

print(ans)

Submission status: Accepted

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

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

count = 1
D = 0

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

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:
        break
    ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

pos = 0
cnt = 1

for i in l:
    pos += i
    if pos <= x:
        cnt += 1
    else:
        break

print(cnt)

Submission status: Accepted

Solution code:
from bisect import bisect_left, bisect_right; from collections import Counter, defaultdict, deque, OrderedDict; from copy import deepcopy; from fractions import gcd; from functools import lru_cache, reduce; from math import ceil, floor; from sys import stdin, setrecursionlimit
import heapq as hq; import itertools as its; import operator as op


# globals
inf = float('inf')
input = stdin.readline


def main():
    n, x = get_li()
    L = get_li()
    P = [0] + list(its.accumulate(L))
    print(len(list(filter(lambda y: y<=x, P))))
    return


def get_int():
    return int(input())


def get_float():
    return float(input())


def get_str():
    return input().strip()


def get_li():
    return [int(i) for i in input().split()]


def get_lf():
    return [float(f) for f in input().split()]


def get_lc():
    return list(input().strip())


def get_data(n, types, sep=None):
    if len(types) == 1:
        return [types[0](input().strip()) for _ in range(n)]
    return list(zip(*(
        [t(x) for t, x in zip(types, input().strip().split(sep=sep))]
        for _ in range(n)
    )))


if __name__ == '__main__':
    setrecursionlimit(4100000)
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n, x = [int(a) for a in input().split()]
l_list = [int(a) for a in input().split()]
for i, l in enumerate(l_list):
    x -= l
    if x < 0:
        print(str(i+1))
        break
else:
    print(str(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())

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

d = 0
count = 1

for l in L:
    d += l
    if d <= X:
        count += 1
    else:
        break

print(count)