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

d = [0]

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n, x = list(map(int, input().split()))
llist = list(map(int, input().split()))
kai = 0
tsumu = 0
while tsumu <= x and llist != [] :
    kai += 1
    tsumu += llist.pop(0)
print(kai)

Submission status: Wrong Answer

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

l = list(map(int, input().split()))
ll = [0]

for i in range(n):
    if i == 0:
        continue
    a = ll[i-1]+l[i-1]
    if a > x:
        break
    else:
        ll.append(a)
print(len(ll))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

cnt = 0
d = 0

while(x >= d):
  d += l[cnt]
  cnt += 1
  if cnt == n:
    break

print(cnt)

Submission status: Wrong Answer

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

bound = 1
a = 0
for i in range(len(d)):
  a += d[i]
  if a >= X:
    break
  bound += 1
  
print(bound)

Submission status: Wrong Answer

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

d = 0
cnt = 1
for i,l in enumerate(l_list):
    d += l

    if d > X:
        break
    cnt += 1
    if i == N-1:
        if d <= X:
            cnt += 1
    
print(cnt)

Submission status: Wrong Answer

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

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)

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


def main():
    n, x = map(int, input().split())
    ls = list(map(int, input().split()))
    count = 0
    d = 0

    for i in range(1, n + 1):
        if d > x:
            print(count)
            exit()

        d = d + ls[i - 1]
        count += 1

    print(count)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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

d = 0
if d > X:
    print(0)
for idx, l in enumerate(Ls):
    d += l
    if d > X:
        print(idx+1)
        exit()

print(len(Ls))

Submission status: Wrong Answer

Solution code:
def resolve():
    (N, X) = list(map(int, input().split(" ")))
    Ls = list(map(int, input().split(" ")))
    cur = 0
    cnt = 0
    for l in Ls:
        if cur > X:
            print(cnt)
            break
        cnt += 1
        cur += l
    print(cnt)

    

if '__main__' == __name__:
    resolve()

Submission status: Wrong Answer

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

cnt = 0
ichi = 0
for l in L_list:
    #print(ichi)
    if ichi > X:
        break
    cnt += 1
    ichi += l

print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, X = input().split(' ')
line = input().split(' ')


cnt = 0
cnt_i = 0
for i in line:
    if cnt_i > int(X):
        break
    cnt_i += int(i)
    cnt += 1

print(cnt)

Submission status: Wrong Answer

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

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

sum = 0
for i, l in enumerate(li):
    if sum > x:
        print(i)

    sum += l

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

Solution code:
def acinput():
    return list(map(int,input().split(" ")))


N,X=acinput()
L=acinput()

count=0
h=0
for i in range(len(L)):
        count+=1
        h+=L[i]
        if h>X:
                break

print(count)

Submission status: Wrong Answer

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

ans = 1
D = 0
while True:
    D += L[ans]
    if D <= X:
        ans += 1
    else:
        break
    if ans > N - 1:
        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, n in enumerate(L):
    x += n
    if x > X:
        print(i+1)
        exit()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n, x=map(int, input().split())
L=[i for i in map(int, input().split())]
counter=1
place=0
for i in range(n):
    place+=L[i]
    if place<=x:
        counter+=1
    elif place>x:
        print(counter)
        break

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)

print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

lenge = 0
counter = 0

for i in range(len(num_list)):
    if X >= lenge:
        lenge += num_list[i]
        counter += 1
    else:
        break

print(counter)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

while res <= x and len(li) > index:
  res += li[index]
  index += 1

print(index)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

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

print(i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, X = [int(i) for i in input().split()]
L = [int(i) for i in input().split()]
D = 0
count = 0
answer = 1

while D <= X:
  D += L[count]
  count += 1
  answer += 1
  if count + 1 > len(L):
    answer -= 1
    break

print(answer - 1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

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

X = NX[1]

bound = 0
point = 0

for i in range(len(L)):
    if point <= X:
        bound += 1
    point += L[i]

print(bound)

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[i]+l[0]<=x:
		d.append(d[i]+l[0])
	else:
		break
print(len(d))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(len(list)):
    bound_list.append(list[i]+bound_list[i])
    if bound_list[len(bound_list)-1]>x:
        print(i+1)
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

ans = 0

sum_L = 0


for i in range(N):
	if(sum_L >= X):
		break;
	ans += 1
	sum_L += L[i]

print(ans)

Submission status: Wrong Answer

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

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

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

for i in range(len(d)):
    if d[i] > X:
        print(i)
        exit()

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline


N,X=map(int,input().split())
L = list(map(int,input().split()))
sums=[0]*(N+1)
c=0
for i in range(1,N+1):
  sums[i] = sums[i-1] + L[i-1]
  if sums[i-1] <= X:
    c+=1
  else:
    print(c)
    exit()
print(c)

Submission status: Wrong Answer

Solution code:
N, X = [int(i) for i in input().split()]
Ls = [int(l) for l in input().split()]
d = 0
res = 0
for i, Li in enumerate(Ls):
    if d <= X:
        res = i+1
    d += Li
if X == d:
    res += 1
print(res)

Submission status: Wrong Answer

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

sum = 0
count = 0
if L[0] > x:
    print(1)

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

Submission status: Wrong Answer

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

print(count)

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,x=map(int,input().split())
L=input().split()
L=[int(i) for i in L]
key=0
d=0
for i in range(n):
    d+=L[i]
    if x<d:
        if i!=0:
            key=i+1
        break
    if i==n-1:
        key=n
print(key)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

pre = 0
counter = 1
if N == 1:
    if L[0] <= X:
        print(2)
    else:
        print(1)
else:
    for i in range(N):
        if pre + L[i] <= X:
            counter += 1
            pre += L[i]
        else:
            print(counter)
            exit()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
N, X = map(int, input().split())
L = list(map(int, input().split()))
L_count = [x for x in L if x <= X]
print(len(L))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 0
for n in range(N):
    ans += L[n]
    if ans > X:
        print(n + 1)
        exit()
print(n + 1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys,collections,math,random;sys.setrecursionlimit(10**7)
def Is(): return [int(x) for x in sys.stdin.readline().split()]
def Ss(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

X,A = Is()
lis = Is()
t = 0
for i in range(X):
    t += lis[i]
    if t > A:
        print(i+1)
        exit()
print(i+1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

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

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

print(i+2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

L = input().split()
cnt = 1
pos = 0
for i in range(N):
        if(pos < X):
                pos += int(L[i])
                cnt += 1
        else:
                break
print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# using main() makes code faster from the point of view of "access to variables in global name-space"
# def main():

# for i, a in enumerate(iterable)
# q, mod = divmod(a, b)
# divmod(x, y) returns the tuple (x//y, x%y)
# manage median(s) using two heapq https://atcoder.jp/contests/abc127/tasks/abc127_f
import sys
sys.setrecursionlimit(10**7)
from itertools import combinations, permutations # https://docs.python.org/ja/3/library/itertools.html
from math import factorial
def combinations_count(n, r):
    # faster than the following code
    # def combinations_count(n, r):
    #     return factorial(n) // (factorial(n - r) * factorial(r))
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n
    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]
    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot
    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])
    return result
def combination_with_repetition_count(n, r):
    return combinations_count(n + r - 1, r)
from collections import deque, Counter # https://docs.python.org/ja/3/library/collections.html#collections.deque
from heapq import heapify, heappop, heappush, heappushpop, heapreplace,nlargest,nsmallest # https://docs.python.org/ja/3/library/heapq.html
from copy import deepcopy, copy # https://docs.python.org/ja/3/library/copy.html
from operator import itemgetter # ex: List.sort(key=itemgetter(1))
from functools import reduce
from fractions import gcd # Deprecated since version 3.5: Use math.gcd() instead.
def gcds(numbers):
    return reduce(gcd, numbers)
def lcm(x, y):
    return (x * y) // gcd(x, y)
def lcms(numbers):
    return reduce(lcm, numbers, 1)

# first create factorial_list
# fac_list = mod_factorial_list(n)
INF = 10 ** 18
MOD = 10 ** 6 + 3
modpow = lambda a, n, p = MOD: pow(a, n, p) # Recursive function in python is slow!
def modinv(a, p = MOD):
    # evaluate reciprocal using Fermat's little theorem:
    # a**(p-1) is identical to 1 (mod p) when a and p is coprime
    return modpow(a, p-2, p)
def modinv_list(n, p = MOD):
    if n <= 1:
        return [0,1][:n+1]
    else:
        inv_t = [0,1]
        for i in range(2, n+1):
            inv_t += [inv_t[p % i] * (p - int(p / i)) % p]
        return inv_t
def modfactorial_list(n, p = MOD):
    if n == 0:
        return [1]
    else:
        l = [0] * (n+1)
        tmp = 1
        for i in range(1, n+1):
            tmp = tmp * i % p
            l[i] = tmp
        return l
def modcomb(n, k, fac_list = [], p = MOD):
    # fac_list = modfactorial_list(100)
    # print(modcomb(100, 5, modfactorial_list(100)))
    from math import factorial
    if n < 0 or k < 0 or n < k: return 0
    if n == 0 or k == 0: return 1
    if len(fac_list) <= n:
        a = factorial(n) % p
        b = factorial(k) % p
        c = factorial(n-k) % p
    else:
        a = fac_list[n]
        b = fac_list[k]
        c = fac_list[n-k]
    return (a * modpow(b, p-2, p) * modpow(c, p-2, p)) % p
def modadd(a, b, p = MOD):
    return (a + b) % MOD
def modsub(a, b, p = MOD):
    return (a - b) % p
def modmul(a, b, p = MOD):
    return ((a % p) * (b % p)) % p
def moddiv(a, b, p = MOD):
    return modmul(a, modpow(b, p-2, p))


# initialize variables and set inputs
#initialize variables
    # to initialize list, use [0] * n
    # to initialize two dimentional array, use [[0] * N for _ in range(N)]
# set inputs
    # open(0).read() is a convenient method:
    # ex) n, m, *x = map(int, open(0).read().split())
    #     min(x[::2]) - max(x[1::2])
    # ex2) *x, = map(int, open(0).read().split())
    #     don't forget to add comma after *x if only one variable is used
# calculate and output
    # output pattern
    # ex1) print(*l) => when l = [2, 5, 6], printed 2 5 6

# set test data
# sys.stdin = open('sample.txt') # for test

# functions used
r = lambda: sys.stdin.readline().strip() #single: int(r()), line: map(int, r().split())
R = lambda: list(map(int, r().split())) # line: R(), lines: [R() for _ in range(n)]
Rmap = lambda: map(int, r().split())
# set inputs

n, x = R()
L = R()
tmp, count = 0, 0
for l in L:
    tmp += l
    count += 1
    if tmp > x:
        break
print(count)

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

Submission status: Wrong Answer

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

s=list(map(int,input().split()))
i=0
ans=0
l=0
while l<=x:
    try:

       l=l+s[i]
       ans+=1
       i+=1
    except:
        break
print(ans)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
n, x = list(map(int, input().split()))
l  = list(map(int, input().split()))
s = 0
l2 = [0]
for _l in l:
    s += _l
    l2.append(s)
    if s > x:
        break
print(len(l2) - 1)

Submission status: Wrong Answer

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

for i in range(0,ll):
    D=D+L[i]
    if D<=x:
        s=s+1


print(s)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

d = 0
for idx, l in enumerate(Ls):
    d += l
    if d > X:
        print(idx+1)
        exit()

print(len(Ls))

Submission status: Wrong Answer

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

for l in L:
    if sum <= X:
        sum += l
        cnt += 1
    else:
        break

print(cnt)

Submission status: Wrong Answer

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

d = 0
c = 1
for i in l:
	d = d + i
	if d>x:
		print(c)
		break
	else:
		c+=1

Submission status: Wrong Answer

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

current = 0
res = 0

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

print(res)

Submission status: Wrong Answer

Solution code:
import sys, re
#from collections import deque, defaultdict, Counter
#from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
#from itertools import permutations, combinations, product
#from operator import itemgetter, mul
from copy import deepcopy,copy
#from string import ascii_lowercase, ascii_uppercase, digits
#from fractions import gcd


def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

n, x = MAP()

lis = MAP()

d = 0
ct = 1


for y in lis:
    d += y
    if d > x:
        print(ct)
        break
    else:
        ct += 1
else:
    print(n)

Submission status: Wrong Answer

Solution code:
N,X = map(int, raw_input().split())
L = map(int, raw_input().split())
D = [0]*(N+2)
for i in range(1, N+1):
    D[i] = D[i-1] + L[i-1]
for i in range(len(D)):
    if D[i] > X:
        print i
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import numpy as np

NX = np.array([int(v) for v in input().rstrip('\n').split()])
distance = np.array([int(v) for v in input().rstrip('\n').split()])

count = 0
pos = 0

for n in range(NX[0]):
  if pos <= NX[1] :
    count+=1 
  pos += distance[n]

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from sys import stdin

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

pos = 0

ans = 0
while ans < n:
    ans += 1
    pos += an[ans-1]
    if x < pos:
        break

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for j in l:
    if t <= x:
        ans += 1
    t += j

print(ans)

Submission status: Wrong Answer

Solution code:
N, X = [int(i) for i in input().split()]
L = [int(i) for i in input().split()]
D = 0
count = 0
answer = 1

while D <= X:
  if count + 1 > len(L):
    break
  D += L[count]
  count += 1
  answer += 1

print(answer - 1)

Submission status: Wrong Answer

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

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

ans = 0

sum_L = 0


for i in range(N):
	if(sum_L > X):
		break;
	ans += 1
	sum_L += L[i]

print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

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 I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    N, X = LI()
    L = LI()
    cur_x = 0
    cnt = 0
    while cur_x <= X and cnt < len(L):
        cnt += 1
        cur_x = cur_x + L[cnt-1]
    print(cnt)
main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if (X < L[0]):
    print(0)
    exit()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(ans)