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: Wrong Answer

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

sum = 0
count = 0
while sum <= x:
    sum += L[count]
    count += 1
    if count == n:
        break


print(count)

Submission status: Wrong Answer

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

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

d = 0

count=0

for i in l:
    if d <= x:
        count+=1
    d = d + i


print(count)

Submission status: Wrong Answer

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

d = 0
count = 1
if len(L) == 1:
    d += L[0]
    if d <= x:
        count += 1
    print(count)
else:
    for l in range(len(L)):
        if d <= x:
            d += L[l]
            if d > x:
                print(count)
                break
            count += 1

Submission status: Wrong Answer

Solution code:
#coding:utf-8

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

l.insert(0,0)

ans = -1
d = 0 
for i in l:
    if d > x:
        break
    ans += 1
    d += i

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
N,X =[int(i) for i in input().split()]
L = [int(i) for i in input().split()]
D = 0
for i in range(N+1):
  if D > X:
    print(i)
    break
  if i==N:
    print(i)
    break
  D += L[i]

Submission status: Wrong Answer

Solution code:
#bin/usr/env python3

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

total_len = 0
for i in range(n):
    total_len += int(length[i])
    if total_len > x:
        print(i+1)
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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


for i in range(n):
   if x > sum(w[:i+1]):
      next
   elif x == sum(w[:i+1]):
      print(i+2)
      break
      
   else:
      print(i+1)
      break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

D=0
i=0
c=0
while D <= X:
    c+=1
    D+=l[i]
    i+=1
    if i+1==len(l):
        break

print(c)

Submission status: Wrong Answer

Solution code:
in1 = list(map(int, input().split()))
N = in1[0]
X = in1[1]
 
L = list(map(int, input().split()))
L.append(0)
D = 0

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

Submission status: Wrong Answer

Solution code:
n, x = map(int, input().split())
l = list(map(int, input().split()))
n = n - 1
l_d = []
d = 0
i = 0
l_d.append(d)
while (d <= x) & (i <= n):
    d = d + l[i]
    l_d.append(d)
    i += 1
print(len(l_d) - 1)

Submission status: Wrong Answer

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

d = 0
for i,l in enumerate(L):
	if d > x:
		print(i+1)
		break
	elif i==n-1:
		print(i+2)
		break
	d += l

Submission status: Wrong Answer

Solution code:
N, X = [int(item) for item in input().split()]
L = [int(item) for item in input().split()][::-1]
D = 0
count = 0
while D <= X and len(L)>0:
  l = L.pop()
  D += l
  count += 1
print (count)

Submission status: Wrong Answer

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

d = 0
count = 1
if len(L) == 1:
    d += L[0]
    count += 1
    print(count)
else:
    for l in range(len(L)):
        if d <= x:
            d += L[l]
            if d > x:
                print(count)
                break
            count += 1

Submission status: Wrong Answer

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

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

for i in range(N):
    if d > X:
        print(i)
        break
    else:
        d += L[i]
if d >X and d-L[len(L)-1] <= X:
    print(N)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


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

Submission status: Wrong Answer

Solution code:


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

ans = 0
cur_X = 0
pos_N = 0

for i in range(N):
    ans += 1
    cur_X += L[i]

    if cur_X > X:
        break

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

line1 = input().split()
n = int(line1[0])
x = int(line1[1])
L = list(map(int,input().split()))

d = 0
for i,l in enumerate(L):
	d += l
	if d > x:
		print(i+1)
		break
	elif i==n-1:
		print(i+2)
		break
	d += l

Submission status: Wrong Answer

Solution code:
#coding:utf-8

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

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

# if ans == len(l):
#     ans += 1

print(ans+1)

Submission status: Wrong Answer

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

i = 0
D = 0

while D <= X:
    D = D + L[i]
    i = i + 1
    if i == N:
        break

print(i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n, x = map(int,input().split())
L_list = list(map(int, input().split()))
# L_list.insert(0,0)
total = 0
ans = 1
# i = 0
# while total < x:
#     total += L_list[i]
#     i += 1
#     ans += 1
# print(ans)

for i in range(len(L_list)):
    total += L_list[i]
    if total < x:
        ans += 1
        continue
    else:
        break
print(ans)

Submission status: Wrong Answer

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

length = 0;
answer = 1;
i = 0;

while length + l[i] <= n[1]:
    length = length + l[i]
    answer = answer + 1
    if(len(l) == (i+1)):
        break;
    i = i + 1

if(answer <= n[0]):
    print(answer)
else:
    print(n[0])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

length = 0
for i, l in enumerate(L):
    if i == N:
        print(i+1)
        break
    length += l
    if length==X:
        print(i+2)
        break
    elif length>X:
        print(i+1)
        break

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

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

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

for i in range(N):
    if x > X:
        print(i)
        break
    else:
        x += L[i]
if x-L[len(L)-1] <= X:
    print(N)

Submission status: Wrong Answer

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

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


for i in range(n):
   if x >= sum(w[:i+1]):
      if i==n:
        print(i+1)
        break
      else:
        next
      
      
   else:
      print(i+1)
      break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import sys;
import string;
sys.setrecursionlimit(20000) # 再起呼び出しの最大数をセット

import copy
import itertools

from functools import lru_cache
#@lru_cache(maxsize = None)

PPP = 1000000007

# 整数の入力
#n = int(input())

# スペース区切りの整数の入力
#a = [int(x) for x in input().split()]
n, x = map(int, input().split())
#print("sp", n, k, file=sys.stderr)
#p, q, r = map(int, input().split())
l = [int(x) for x in input().split()]

# 改行区切りの整数の入力
#a = []
#for x in range(n):
#  a.append(int(input()))
#  a.append([int(x) for x in input().split()])
#p = [int(x) for x in input().split()]
#a.sort()
#print(l, file=sys.stderr)

# 文字列の入力
#s = input()

# 出力
#print("{} {}".format(a+b+c, s))
#a.sort()
#print(set(a), file=sys.stderr)
#print(len(set(a)))

#cache = dict()

import re

def doit():
  if n == 1:
    return 1
  p = 0
  res = 0
  for lx in l:
    if x < p:
      break
    p += lx
    res += 1
  
  return res

#print(doit([0] * 4))
#doit(s)
try:
  print(doit())
except Exception as e:
  print("e", e, file=sys.stderr)

Submission status: Wrong Answer

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

for d in l:
	if(distance <= x):
		count = count + 1
		distance = distance + d
print(count)

Submission status: Wrong Answer

Solution code:
from sys import exit
n,x=map(int,input().split())

l=tuple(map(int,input().split()))
d=[0 for i in range(n+2)]


for i in range(n):
    
    d[i+1]=d[i]+l[i]
    if d[i+1]>x:
        print(i+1,d)
        exit()
print(n+1)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# 入力の受付
n, x = map(int, input().split())
l_list = input().split()


# 回数の記録
count = 0
d_list = list()
for i in range(n):
    if i == 0:
        count += 1
        d_list.append(0)
    elif i > len(l_list):
        break
    else:
        d_list.append(d_list[i-1] + int(l_list[i-1]))
        if d_list[i] <= x:
            count += 1


# 結果の出力
print(count)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n,x=map(int,input().split())
ln= list(map(int, input().split()))
result=[]
for i in range(0,n+1):
    a=ln[:i]
    b=sum(a)
    d=b
    result.append(d)
    if b>x:
        break
e=len(result)

if e>n+1:
    print(n+1)
else:
    print(e-1)

Submission status: Wrong Answer

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

length = 0
for i, l in enumerate(L):
    length += l
    if length==X:
        print(i+2)
        break
    elif length>X:
        print(i+1)
        break
    if i == N:
        print(i+1)
        break

Submission status: Wrong Answer

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

a=0
count=1
for i in range(N-1):
#     print(i)
#     print(L[i])
    a+=L[i]
#     print(a)
    if(a<=X):
#         print(a)
        count+=1
print(count)

Submission status: Wrong Answer

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

dist = 0

for (i, v) in enumerate(L):
  dist += v
  if dist <= x:
    continue
  else:
    break
    
print(i+1)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
N,X = map(int,input().split())

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


res = 0
i = 0
ans = 1
for i in range(N):
    res += li[i]
    ans += 1
    if res > X:
        ans -= 1
        break
    
print(res)
print(min(ans,N+1))

Submission status: Wrong Answer

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

N = INPUT[0]
X = INPUT[1]

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

count = 0 

i = 0
value = 0
while(i < N):
    if(value <= X):
        count += 1
        value += L[i]
    i += 1
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

dist = 0

for (i, v) in enumerate(L):
  dist += v
  print(dist)
  if dist <= x:
    continue
  else:
    break
    
print(i+1)

Submission status: Wrong Answer

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

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

    ans += 1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = 0
d = 0
for i in b:
    for j in b:
        if a[0] == 0:
            break
        elif a[1] < j:
            d = 1
            break
        elif c > a[1]:
            break
        else:
            c += j
            d += 1
print(d)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

d = 0
count = 1
try:
    for l in range(len(L)):
        if d <= x:
            d += L[l]
            if d > x:
                print(count)
                break
            count += 1
except:
    print(count)
    pass

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

cnt = 0
d = 0
for n in range(N):
    if d <= X:
        cnt += 1
        d += L[n-1]
    else:
        break
print('{}'.format(cnt))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import sys
# 入力の受付
n, x = map(int, input().split())
l_list = input().split()

# 入力チェック
if not((1 < n) and (n < 100)) or not((1 < len(l_list)) and (len(l_list) < 100)) or not((1<x) and (x < 10000)):
    sys.exit()

# 回数の記録
count = 0
d_list = list()
for i in range(n):
    if i == 0:
        count += 1
        d_list.append(0)
    else:
        d_list.append(d_list[i-1] + int(l_list[i-1]))
        if d_list[i] <= x:
            count += 1


# 結果の出力
print(count)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a=list(map(int,input().split()))
L=list(map(int,input().split()))
N=a[0]
X=a[1]
l=[0]
n=0
n1=0
while True:
    l.append(L[n]+l[n])
    n=n+1
    if n==N:
        break
print(l)
while True:
    if l[n1]<=X:
        n1+=1
    else:
        print(n1)
        break
    if n1==N:
        if X>=l[-1]:
            print(n1+1)
            break
        else:            
            print(n1)
            break

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n, x = list(map(int, input().split()))
L = list(map(int, input().split()))
posi = 0;cnt = 1;

for i in range(n):
	posi += L[i]
	if posi <= x:
		cnt += 1
	else:
		print(cnt)
		break

Submission status: Wrong Answer

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

zahyou = 0
ans = 0

for s in l:
    if zahyou <= x:
        ans += 1
    zahyou += s

print ans

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
n,x=map(int,input().split())
l=list(map(int,input().split()))
height=0
lis=[0]
for i in range(n):
    height+=l[i]
    lis.append(height)
    if lis[-1]<x:
        pass
    elif lis[-1]==x:
        print(len(lis))
        break
    elif lis[-1]>x:
        print(len(lis)-1)
        break

Submission status: Wrong Answer

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

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


for i in range(n):
   if x >= sum(w[:i+1]):
      if i==n:
        print(i+1)
      else:
        next
      
      
   else:
      print(i+1)
      break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

l=tuple(map(int,input().split()))
d=[0 for i in range(n+2)]


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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

length = 0
for i, l in enumerate(L):
    length += l
    if length==X:
        print(i+2)
        break
    elif length>X:
        print(i+1)
        break
    if i == N:
        print(i)
        break

Submission status: Wrong Answer

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

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

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

if x <= X:
    print(N)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,x=map(int,input().split())
ln= list(map(int, input().split()))
result=[]
for i in range(0,n+1):
    a=ln[:i]
    b=sum(a)
    d=b
    result.append(d)
    if b>x:
        break
e=len(result)
f=e-1
print(f)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i, l in enumerate(L):
  if i == 0:
    D = 0
  else:
    D = int(l) + D
    
  if D > int(x):
    print(i)
    break

if D <= int(x):
  print(int(n))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
n,x=map(int,input().split())
L=input().split()
L=[int(i) for i in L]
count=0
l=0
while l<=x:
    if count>n-1:
        break
    else:
        l=l+L[count]
        count=count+1
print(count)

Submission status: Wrong Answer

Solution code:
n,x = (int(x) for x in input().split())
l=list(map(int,input().split()))
k=0
d=0

while d<=x:
   if len(l)<=k:
    break
   else:
    d=d+l[k]
    k=k+1
  
print(k)

Submission status: Wrong Answer

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

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

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

if x <= X:
    print(N)

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline


def main():
    n, x = [int(i) for i in input().split()]
    l_list = [int(i) for i in input().split()]
    d = 0
    num = 1
    for i in range(1, n):
        d = d + l_list[i - 1] * (i <= n + 1)
        if d > x:
            break
        num += 1
    print(num)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


b()

Submission status: Wrong Answer

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

for i, num in enumerate(list_):
  l += num
  if l > x:
    print(i+1)
    break

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
N,X = map(int,input().split())

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


res = 0
i = 0
ans = 1
for i in range(N):
    res += li[i]

    if res > X:
        break
    

print(min(i+1,N+1))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 0
bound = 1

if n == 1:
    if n == l_list[0]:
        print(bound + 1)
    else:
        print(bound)
    exit(0)

for i in l_list:
    ans += i
    if ans >= x:
        if ans == x:
            bound += 1
        print(bound)
        break
    bound += 1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,x = (int(x) for x in input().split())
l=list(map(int,input().split()))
k=1
d=0

while d<=x:
   if n<=k:
    break
   else:
    d=d+l[k-1]
    k=k+1
  
if n+1<k:
  print(n+1)
else:print(k)

Submission status: Wrong Answer

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

zahyo = 0
cnt = 0
for i in range(n):
    cnt += 1
    zahyo += ls[i]

    if zahyo > x:
        print(cnt)
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a=list(map(int,input().split()))
n=1
zahyo=0
hane=list(map(int,input().split()))
for i in range(a[0]):
    if zahyo+hane[i]>a[1]:
        print(n)
        break
    elif zahyo+hane[i]<=a[1] and i==a[0]-1:
        print(n)
    else:
        zahyo=zahyo+hane[i]
        n=n+1

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

d = 0
ans = 0

if d <= x:
    ans = 1
else:
    ans = 0

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

print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np

if __name__ == "__main__":
    n,x = map(int, input().split())
    l = list(map(int, input().split()))
    d = []
    for i in range(n + 1):
        if i == 0:
            d.append(0)
        else:
            d.append(d[i-1] + l[i-1])

    answer_array = np.array(d) < x
    print(sum(answer_array))

Submission status: Wrong Answer

Solution code:
import numpy as np

n, x = map(int, input().split())
L = [l for l in map(int, input().split())]

L = np.array([0] + L)
S = np.zeros_like(L)

for i in range(len(S)):
  S[i] = np.sum(L[:i+1])
  
for (i, s) in enumerate(S):
  if s > x:
    break
print(i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

    #while True:
        #i = 0
        #max += l[i]
        #if max < x:
            #ans += 1
        #i += 1

    for i in range(len(l)):
        max += l[i]
        if max < x:
            ans += 1
    print(ans)

main()

Submission status: Wrong Answer

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

cnt = 0
D = 0
while D <= X and cnt < len(L):
    D += L[cnt]
    cnt += 1
if cnt == len(L):
    cnt += 1

print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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