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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*-coding: utf-8 -*-
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]
    # print(i+1, D)
    if D > X:
        ans = i
        break
    if i == N:
        ans = i+1

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

bounds = [0]

for i in range(1, n+1):
  bounds.append(bounds[i-1] + l[i-1])
  
count = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin

n,x = [int(x) for x in stdin.readline().rstrip().split()]
li = list(map(int,stdin.readline().rstrip().split()))

from itertools import accumulate

li2 = list(accumulate(li))
li2.append(0)
li2.sort()
print(len([i for i in li2 if i <= x]))

Submission status: Accepted

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

list_L_hane = [0] + list_L
for i in range(1, len(list_L_hane)):
    list_L_hane[i] = list_L_hane[i] + list_L_hane[i - 1]

score = 0
for i in list_L_hane:
    if i <= x:
        score += 1
    else:
        break

print(score)

Submission status: Accepted

Solution code:
N, X = map(int, input().split())
L = list(map(int, input().split()))
num = 0
for n, l in enumerate(L):
    num += l
    if num > X:
        print(n + 1)
        exit()
print(N + 1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
limit = input().split()
hane = input().split()
hane = [int(i) for i in hane]

tmp = 0
ans = 0
for i in hane:
  tmp += i
  if tmp<=int(limit[1]): ans +=1
  else: break
    
print(ans+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 = 0
for i in l:
    if d > x:
        break
    count += 1
    d += i

if d <= x:
    count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

a = [sum(l[:x+1]) for x in range(len(l))]
b = []
for i in range(len(a)):
    if a[i] <= x:
        b.append(a[i])

print(b.index(b[-1])+2)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#ABC130B - Bounding
N, X = list(map(int,input().split()))
l = list(map(int,input().split()))
count = 1
x = 0
for i in range(N):
    x += l[i]
    if x <= 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
bound = 0
for i in range(N):
    bound += L[i]
    if bound <= X:
        cnt += 1
    else:
        continue
print(cnt)

Submission status: Accepted

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

d, res = 0, 1
for l in L:
    d += l
    if d <= X:
        res += 1
    else:
        break
print(res)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

print(res)

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

print(len(D))

Submission status: Accepted

Solution code:
import bisect

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

li=[0]*(n+1)

for i in range(n):
  li[i+1]=li[i]+l[i]
  
print(bisect.bisect(li,x))

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(cnt + 1)

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(2,n+2):
    L += l[i-2]
    if i == n+1 and L<x:
        print(n+1)
        exit()

    if L > x:
        print(i-1)
        exit()
    if L == x:
        print(i)
        exit()

    else:
        continue

Submission status: Accepted

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


print(count)

Submission status: Accepted

Solution code:
import numpy as np


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

initial_val = 0
res = 0

if initial_val <= X:
    res += 1

for i in range(N):
    cd = initial_val + L_list[i]
    if cd <= X:
        res += 1
    initial_val = cd
    i += 1

print(res)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#coding:utf-8
n,x= map(int,input().split())
L = list(map(int,input().split()))


coordinate=0
ans = 1
for e in L:
    if coordinate+e<=x:
        ans+=1
        coordinate+=e
    else:
        break

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin

n, x = [int(x) for x in stdin.readline().rstrip().split()]
l_lst = [int(x) for x in stdin.readline().rstrip().split()]
d = 0
count = 0

for i, l in enumerate(l_lst):
  if d > x:  break
  else: count += 1
  d += l

if i == n-1 and d <= x:
  count += 1
 
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# -*- coding:utf8 -*-

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

Submission status: Accepted

Solution code:
N,X=map(int,input().split())
List=list(map(int,input().split())) 
count=1
for i in range(1,N+1):
  if sum(List[0: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];count = 1

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n, x = map(int, input().split())
l = list(map(int, input().split()))

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def slove():
    import sys
    input = sys.stdin.readline
    n, x = list(map(int, input().rstrip('\n').split()))
    l = list(map(int, input().rstrip('\n').split()))
    cnt = 1
    t = 0
    for i in range(n):
        t += l[i]
        if t <= x:
            cnt += 1
    print(cnt)


if __name__ == '__main__':
    slove()

Submission status: Accepted

Solution code:
N, X = map(int, input().split())
L = list(map(int, input().split()))
cnt = 0
x = 0
i = 0
while(X >= x):
    cnt += 1
    try:
        x += L[i]
    except Exception as identifier:
        break
    i += 1
print(cnt)

Submission status: Accepted

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

ans = [0]
cnt = 0

for i in L:
	cnt = i + cnt
	if cnt<=X:
  		ans.append(cnt)
	else:
		break
print(len(ans))

Submission status: Accepted

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

    count = 1
    distance = 0

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

    print(count)
    
if __name__ == "__main__":
    main()

Submission status: Accepted

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

ans = [0]
cnt =0
for i in L:
    cnt =i + cnt
    if cnt <= X:
        ans.append(cnt)
    else:
        break
   
print(len(ans))

Submission status: Accepted

Solution code:
import sys

def main():
    N, X = map(int, input().split())
    A = list(map(int, input().split()))
    cnt = 1
    D = 0
    for a in A:
        D += a
        if D > X:
            break
        cnt += 1

    return cnt

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

Submission status: Accepted

Solution code:
def resolve():
    n,x = list(map(int, input().split()))
    lll = list(map(int, input().split()))
    d = 0
    flag=False
    count = 1
    for i in range(n):
        d = d + lll[i]
        if d > x:
            flag = True
            print(count)
            break
        else:
            count += 1
    if flag == False:
        print(n+1)
resolve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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(1,n+1):
    d.append(d[i-1] + l[i-1])
    if d[i] > x:
        print(len(d) - 1)
        exit()
print(n+1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

count=1
D=0
for move in L :
    D = D + move
    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()))
d = 0
cnt = 1
for i in l:
    d = 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
a = [0]
cnt = 0
for i in l:
    a.append(d+i)
    d = d+i
for n in a:
    if n <= x:
        cnt += 1
print(cnt)

Submission status: Accepted

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

num = 0
ans = 1
for i in l:
    num += i
    if num > m:
        break
    else:
        ans +=1
    
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
while True:
    try:
        N, X = map(int, input().split())
        L = list(map(int, input().split()))
        D = [0]
        for i in range(1, N+1):
            tmp = D[i-1] + L[i-1]
            D.append(tmp)
            if tmp > X:
                print(i)
                break
        else:
            print(N+1)
    except:
        break

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
# B - Bounding
N, X = map(int,input().split())
L = list(map(int, input().split()))
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:
n,x = map(int,input().split())
l_list = list(map(int,input().split()))
count = 1
num_sum = 0
for i in range(n):
    num_sum += l_list[i]
    if num_sum > x:
        break 
    count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,x,*l=map(int,open(0).read().split())
print(sum(x>=sum(l[:i+1])for i in range(n))+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
N,X = map(int,input().split())
L = list(map(int,input().split()))
D = 0
i = 0
while D <= X:
    D = (D + L[i])
    i += 1
    if i == N and D <= X:
        print(i+1)
        sys.exit()
print(i)

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 = map(int, input().split())
L = list(map(int, input().split()))
coodinate = 0
ans = 1
for i, l in enumerate(L):
  coodinate += l
  if coodinate > X:
    break
  ans += 1
print(ans)

Submission status: Accepted

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

arr=[]
for i in range(n+1):
  if i==0:
    arr.append(0)
  else:
    arr.append(arr[i-1]+L[i-1])

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

Submission status: Accepted

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

i = 0
while i <= N-1:
  S.append(S[i]+L[i])
  i += 1
  
j = 0
while j <= N:
  if S[j]<= X:
    c += 1
    j += 1
  
  else:
    j += 1

    
print(c)

Submission status: Accepted

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

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

Submission status: Accepted

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


from sys import stdin
import itertools



############################################

# read data for n sequences.
temp = stdin.readline().split()
N = int(temp[0])
X = int(temp[1])

data = []
write = stdin.readline().split()
for i in range(N):
    data.append(int(write[i]))
    
count = 1
dis = 0

for d in data:
    dis += d
    if dis <= X:
        count += 1
    else:
        break

print(count)

Submission status: Accepted

Solution code:
n,disup=map(int,input().split())
A=list(map(int,input().split()))
dis=0
ans=1
for i in A:
  dis+=i
  if dis>disup:
    print(ans)
    exit()
  if dis==disup:
    print(ans+1)
    exit()
  ans+=1
print(ans)

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,x = map(int,input().split())
ls = [int(i) for i in input().split()]
points = [sum([ls[j] for j in range(i+1)]) for i in range(n)]
points.insert(0,0)
count = 0
for i in range(n+1):
    if points[i] <= x:
        count = count + 1

print(count)

Submission status: Accepted

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

for i in range(len(l)):
    if i == 0:
        bl[i] = l[i]
    else:
        bl[i] = l[i] + bl[i-1]

bl = list(filter(lambda i: i<=x, bl))
print(len(bl)+1)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
k = 1
s = 0
for i in map(int, input().split()):
    if s + i <= b:
        k += 1
    s += i
print(k)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = raw_input()
input = n.split(" ")
n, x = input[0], input[1]
l = raw_input().split(" ")
current = 0
bounce = 1
for i in range(len(l)):
    current += int(l[i])
    if current <= int(x):
        bounce += 1
    else:
        break
print(bounce)

Submission status: Accepted

Solution code:
N, X = map(int,input().split())
L = list(map(int,input().split()))
ans = 1
D = L[0]
while D<=X and ans<N+1:
    ans+=1
    if ans < N+1: #N+1回以降ははねない
        D+=L[ans-1]
print(ans)

Submission status: Accepted

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

for i in range(N+1):
    t += L[i]
    if t <= X:
        ans += 1
        continue
    break
print(ans)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
k = 1
s = 0
for i in map(int, input().split()):
    if s + i <= b:
        k += 1
    s += i
print(k)

Submission status: Accepted

Solution code:
import sys
from math import ceil

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

def iinput():
    return int(input())

def finput():
    return float(input())

def tinput():
    return input().split()

def rinput():
    return map(int, tinput())

def rlinput():
    return list(rinput())

def nok(a, b):
    m = a * b
    while a != 0 and b != 0:
        if a > b:
            a %= b
        else:
            b %= a
    return m // (a + b)    


def main():
    n, x = rinput()
    l = rlinput()
    d = 0
    res = 1
    for i in range(n):
        d += l[i]
        if d > x:
            break
        else:
            res += 1
    print(res)
    
    
    
main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,x=input().split()
L = list(input().split())
d = 0
i = 0
while d <= int(x) and i<int(n):
    d+=int(L[i])
    i+=1
if d > int(x):
    print(i)
else:
    print(i+1)

Submission status: Accepted

Solution code:
n, m = map(int, input().split())
l = [int(x) for x in input().split()]
answ = 1
h = 0
for k in l:
  h += k
  if h > m:
    break
  else:
    answ += 1
print(answ)

Submission status: Accepted

Solution code:
n, x = map(int, input().split())
l = [int(i) for i in input().split()]
d = [0]
cnt = 1
while cnt != n + 1 and d[-1] <= x:
	d.append(d[-1] + l[cnt - 1])
	cnt += 1
if d[-1] <= x: 
	print(cnt)
else:
	print(cnt - 1)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in L:
    tmp += i
    if tmp > X:
        break

    output += 1

print(output)

Submission status: Accepted

Solution code:
N,X=map(int, input().split())
L=list(map(int, input().split()))
s=[x for x in range(len(L)+1) if sum(L[:x])<=X]
if N+1>=len(s):
  print(len(s))
else:
  print(N+1)

Submission status: Accepted

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

Submission status: Accepted

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

s = 0
cnt = 1
for n in range(N):
    s += L[n]
    if s > X:
        break
    cnt += 1

print (cnt)

Submission status: Accepted

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

ans = 1
distance = 0
for n in L:
    distance = distance + n
    if distance <= X:
        ans += 1
    else:
        break

print(ans)

Submission status: Accepted

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