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(" "))
Llist = list(map(int, input().split(" ")))
ans = 1
now = 0
for i in range(N):
    now += Llist[i]
    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()))

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**7)

#debug = True
debug = False

def dprint(*objects):
    if debug == True:
        print(*objects)



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

    d = 0
    count = 1
    for l in l_list:
        d = d + l
        if d <= x:
            count += 1
        else:
            break
    print(count)

solve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(cou)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

D = [0]
prev = 0

for i in range(1, N+1):
    cur = prev + L[i-1]
    D.append(cur)
    if cur > X:
        print(i)
        break
    prev = cur
else:
	print(N+1)

Submission status: Accepted

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

Submission status: Accepted

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

D = []
D.append(0)

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

Submission status: Accepted

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

num = [int(a) for a in input().split()]

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

    cnt += 1

print(cnt)

Submission status: Accepted

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

ans = 1
point = 0

for L in Lli:
    point = point + L
    if point <= X:
        ans = ans + 1
    else:
        break

print(ans)

Submission status: Accepted

Solution code:

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

sum_ = 0

ans = 0

for i in range(N):
    sum_ += L_lst[i]
    if sum_ > X:
        ans = i + 1
        break
if ans == 0:
    ans = N + 1

print(ans)

Submission status: Accepted

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

from itertools import accumulate

def solve():
    N, X = map(int, input().split())
    *L, = filter(X.__ge__, accumulate(map(int, input().split())))
    res = len(L)+1
    return str(res)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:


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

    d = [0] + [l for l in L]
    for i in range(1, len(d)):
        d[i] = d[i-1] + L[i-1]
    a = [x for x in d if x <= X]
    print(len(a))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

now_position = 0
count = 1
for L in L_li:
    now_position += L
    if now_position > X:
        break
    count += 1

print(str(count))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

d = 0
jump = [0]
for i in range(n):
    d = d + L[i]
    if d <= x:
        jump.append(d)
    else:
        break

print(len(jump))

Submission status: Accepted

Solution code:
hoge = input().split()
N = int(hoge[0])
X = int(hoge[1])
L = []
huga = input().split()
for i in range(N):
  L.append(int(huga[i]))
  
now = 0
count = 1
for i in range(len(L)):
  now += L[i]
  if now <= X:
    count += 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from itertools import accumulate

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

L = map(int, input().split())
tmp = [0] + list(accumulate(L))

print(len([_ for _ in tmp if _ <= X]))

Submission status: Accepted

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

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)

Submission status: Accepted

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

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

print(count+1)

Submission status: Accepted

Solution code:
N, X = map(int, input().split())			# "5 7" -> ["5", "7"] -> 5, 7 => N=5,K=7

L = list( map(int, input().split()) )	# 1 2 3 4 5 ...

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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 = D + l
    if D <= X:
        ans = ans + 1

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# ABC130B - Bounding
n, x = list(map(int, input().rstrip().split()))
lst = list(map(int, input().rstrip().split()))
cur, ans = 0, 0
for i in lst:
    if cur <= x:
        ans += 1
    cur += i
print(ans + 1 if cur <= x else ans)

Submission status: Accepted

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

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

print ans

Submission status: Accepted

Solution code:
import sys,heapq
from collections import deque,defaultdict
printn = lambda x: sys.stdout.write(x)
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
DBG = True # and False
def ddprint(x):
  if DBG:
    print(x)

n,x = inm()
l = inl()
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()))
cnt = 0
D = [0]
for i in range(1,N+1):
    D.append(D[i-1] + L[i-1])
for i in range(len(D)):
    if D[i] <= X:
        cnt += 1
print(cnt)

Submission status: Accepted

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

ans,x = 1,0

for l in L:
  x += l
  if x > M:
    break
  ans += 1

print(ans)

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

count = 1
position = 0

while L and position <= X:
    position += L.pop(0)
    if position <= X:
        count += 1

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

print(ans)

Submission status: Accepted

Solution code:
import sys
#input = sys.stdin.readline
from sys import setrecursionlimit
setrecursionlimit(10**9)

def inpl(): return list(map(int, input().split()))
N, X = inpl()
L = inpl()[::-1]
D = 0
ans = 1
D += L.pop()
while D <= X:
    ans += 1
    if len(L):
        D += L.pop()
    else:
        break
print(ans)

Submission status: Accepted

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

for i in l:
    plc += i
    if plc <= x:
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
# coding: utf-8

import sys
def input(): return sys.stdin.readline().strip()

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

ans = [0]
for i, l in enumerate(L):
    ans.append(ans[i] + l)

aa = 0
for a in ans:
    if a <= X:
        aa += 1

print(aa)

Submission status: Accepted

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

L = map(int, raw_input().split())

bound_count = 1
sum_L = 0

for l in L:
    sum_L += l
    if sum_L > X:
        break
    bound_count += 1
print bound_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:
        break
    ans += 1 
print(ans)

Submission status: Accepted

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

ball = 0
cnt = 0

for l_i in l:
    ball += l_i
    if ball <= x:
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
import numpy as np
n, x = map(int, input().split())
l_arr = np.array(list(map(int, input().split())))
print((np.cumsum(l_arr) <= x).sum() + 1)

Submission status: Accepted

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

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

L.append(0)

s = [0]
for i in range(1, N+1):
    s.append(s[i-1]+L[i-1])

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

print(ans)

Submission status: Accepted

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

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

print(cnt+1)

Submission status: Accepted

Solution code:
from itertools import accumulate
from sys import stdin
N, X = [int(_) for _ in stdin.readline().rstrip().split()]
L = [int(_) for _ in stdin.readline().rstrip().split()]
L = [0]+list(accumulate(L))
print(len([l for l in L if l <= X]))

Submission status: Accepted

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

Submission status: Accepted

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

cnt = n + 1
for i in range(n):
    if sum(ls[:i+1]) > x:
        cnt = i + 1
        break

print(cnt)

Submission status: Accepted

Solution code:
#
import sys
import math
import numpy as np
import itertools


# いくつか入力
n,x = (int(i) for i in input().split())  


# リストに入れる
l = [int(i) for i in input().split()] 
a=0
answer = 1
for i in range(n):
    if l[i]+a > x:
        break
    else:
        answer += 1
        a += l[i]

print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

print(cnt)

Submission status: Accepted

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

i, Y = 0, 0
while i < N:
    if Y + L[i] <= X:
        Y += L[i]
        i += 1
    else:
        break
print(i + 1)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

bound = 1

now_pos = 0
for L in LX:
    now_pos = now_pos + L
    if now_pos <= X:
        bound += 1
    else:
        break
print(bound)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#n = int(input())
#m = int(input())
#k = int(input())
n, x = map(int, input().split())
#n, m, k = map(int, input().split())
l = list(map(int, input().split()))
#table = []
'''
for i in range h:
    temp = list(map(int, input().split()))
    table.append(temp)
'''
d = 0
count = 1
for i in range(n):
    d += l[i]
    if d <= x:
        count += 1
    else:
        break
print(count)

Submission status: Accepted

Solution code:
import sys

fin = sys.stdin.readline
N, X = [int(elem) for elem in fin().split()]
l_list = [int(elem) for elem in fin().split()]

count = 1
current_d = 0
for l in l_list:
    current_d += l
    if current_d > 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
D=0
if D<=X:
    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()))
z = 0
count = 1
for t in l:
    z = z + t
    if z <= x:
        count += 1
print(count)

Submission status: Accepted

Solution code:
import math

#n = int(input())
n, m = [int(i) for i in input().split()]
#table = [[int(i) for i in input().split()] for j in range(n)]
#table = [list(input()) for n in range(h)]
list = [int(i) for i in input().split()]
#num = [int(i) for i in range(n)]
#s = input()
#list = list(s)

kotae = 1
total = 0

for i in range(n) :
    if (total + list[i] > m) :
        break
    total += list[i]
    kotae += 1

print(kotae)

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

Submission status: Accepted

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

Submission status: Accepted

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

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

l = list(map(int, input().split()))
a = []
for i in range(n+1):
    if i == 0:
        a.append(0)
        continue
    a.append(a[i-1]+l[i-1])

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

Submission status: Accepted

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

for l in l_list:
    d += l
    if d > x:
        break
    bound += 1
print(bound)

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N, X = map(int, input().split())
L = map(int, input().split())
ans = 1
le = 0
for l in L:
    le += l
    if le > X:
        break
    ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline

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

ans = 1
tmp = 0
for l in L:
    tmp += l
    if tmp > X:
        break
    else:
        ans += 1
print(ans)

Submission status: Accepted

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

count = 1
dist = 0
for l in L:
    dist += l
    if dist > X:
        break
    count += 1

print(count)

Submission status: Accepted

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

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

count = 1
dis = 0

for l in ls:
    new_dis = dis + l
    if(new_dis <= X):
        count += 1
        dis  = new_dis
    else:
        break

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N, X = map(int, input().split())
L_list = list(map(int, input().split()))
btimes = 1
longs = 0
for idx, ite in enumerate(L_list):
    longs += ite
    if longs > X:
        break
    btimes += 1
print(btimes)

Submission status: Accepted

Solution code:
inputs = list(map(int, input().split()))
N,X = inputs
li = list(map(int, input().split()))
bound=1
length=0
for i in li:
    length += i
    if length > X:
        break
    bound +=1
print(bound)

Submission status: Accepted

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

ans = 1
prev = 0
for i in range(len(a)):
    prev += a[i]
    if prev > x:
        break
    else:
        ans += 1
print(ans)

Submission status: Accepted

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

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

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve():
    N, X = [int(_) for _ in raw_input().split()]
    L = [int(_) for _ in raw_input().split()]
    ans = 1
    D = 0
    for i in range(N):
        D += L[i]
        if D > X:
            break
        else:
            ans += 1
    print ans

if __name__ == '__main__':
    solve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n, x = map(int, input().split())
li = list(map(int, input().split()))
d = [0]
for a in li:
    d.append(d[-1] + a)
ans = sum(a <= x for a in d)
print(ans)

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LS()
    return l
sys.setrecursionlimit(1000000)
mod = 1000000007

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

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

Submission status: Accepted

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

NX = input()
N = int(NX.split(' ')[0])
X = int(NX.split(' ')[1])

L = map(int, input().split(' '))
cnt = 0
result = 1
for i in L:
    cnt += i
    if cnt <= X:
        result += 1

print(result)

Submission status: Accepted

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

for l in L:
    position += l
    if (position <= X):
        ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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


def f(N, X, L):
    d = 0

    for i, l in enumerate(L):
        d += l
        if d > X:
            return i+1

    return N+1


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

    print(f(N, X, L))



if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

print(bound)

Submission status: Accepted

Solution code:
'''
allinputs = iter(input().splitlines())
input = lambda : next(allinputs)
#'''
N, X = map(int, input().split())
L = list(map(int, input().split()))

count = 1
pos = 0

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n,x=map(int,input().split())
ls=list(map(int,input().split()))
count=1
dist=0
for i in ls:
    dist+=i
    if dist<=x:
        count+=1
    else:
        break
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()
from collections import defaultdict

n, x = LI()
ls = LI()

ans = 1
l = 0
for i in ls:
    l = l + i
    if l <= x:
        ans += 1
    else:
        break

print(ans)