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 = list(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

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

Solution code:
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
inf=float('inf')
mod = 10**9+7
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    N, X = MI()
    L = LI()
    now = 0
    ans = 1
    for l in L:
        now += l
        if now <= X:
            ans += 1
    print(ans)
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, X = map(int, raw_input().split())
L = map(int, raw_input().split())
D = [0]
for l in L:
 D.append(D[-1] + l)
print sum(d <= X for d in D)

Submission status: Accepted

Solution code:
import math

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

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

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

print(count)

Submission status: Accepted

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

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

def LI(): return list(map(int,input().split()))
def I(): return int(input())
def LS(): return input().split()
def S(): return input()

def main():
  n,x=LI()
  l=LI()

  a=0
  c=1
  for b in l:
    a+=b
    if a<=x:
      c+=1
    else:
      break

  return c

print(main())

Submission status: Accepted

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

pos = 0
cnt = 1
for _l in l:
    pos += _l
    if pos > X:
        break
    cnt += 1

print(cnt)

Submission status: Accepted

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

cur = 0
cnt = 0
for i in range(n):
  if cur <= x:
    cnt += 1
  cur += ls[i]
if cur <= x:
  cnt += 1

print(cnt)

Submission status: Accepted

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

ans = 0
z = 0
pr = 0
for i in range(N+1):
    if i >= 1:
        z = l_list[i-1] + pr
    if z <= X:
        ans += 1
    pr = z
print(ans)

Submission status: Accepted

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

x, count = 0, 0
for l in L:
	x += l
	if x <= X:
		count += 1
print(count + 1)

Submission status: Accepted

Solution code:
#import numpy as np
#from numpy import*
#from scipy.sparse.csgraph import shortest_path #shortest_path(csgraph=graph) # dijkstra# floyd_warshall
#from scipy.sparse import csr_matrix
 
from collections import* #defaultdict Counter deque appendleft
from fractions import gcd
from functools import* #reduce
from itertools import* #permutations("AB",repeat=2) combinations("AB",2) product("AB",2) groupby accumulate
from operator import mul,itemgetter
from bisect import* #bisect_left bisect_right
from heapq import* #heapify heappop heappushpop
from math import factorial,pi
from copy import deepcopy
import sys
sys.setrecursionlimit(10**8)
#input=sys.stdin.readline  #危険！基本オフにしろ！

a,b=map(int,input().split())
*x,=list(accumulate(map(int,input().split())))
x=[-1]+x
#print(x)
print(bisect_right(x,b))

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
Max = sys.maxsize
def l():
    return list(map(int,input().split()))
def m():
    return map(int,input().split())
def onem():
    return int(input())
def s(x):
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa == x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x):
    return " ".join(map(str,x))

n,x = m()
l = l()

co = 0

ans = 1

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

print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8

x,a=map(int,input().split())
t=list(map(int,input().split()))
count=1
for y in t:
    a-=y
    if a>=0:
        count+=1
print(count)

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin

sys.setrecursionlimit(10 ** 7)

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x) - 1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

n, x = li()
l = list(li())

cur = 0
ans = 1

for lli in l:
    cur += lli
    if cur <= x:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
ri = lambda: int(input())
#rl = lambda: [int(x) if x.isdecimal() else x for x in input().split()]
#rl = lambda: list(input().split()))
rl = lambda: map(int,input().split())
rr = lambda N: [list(l) for l in zip(*[rl() for _ in range(N)])]
YN = lambda b: print('YES') if b else print('NO')
yn = lambda b: print('Yes') if b else print('No')
OE = lambda x: print('Odd') if x%2 else print('Even')
INF = 10**18
MOD = 10**9+7

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

D = 0
ans = 1
for l in L:
    D+=l
    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()))

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


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

L=list(map(int,input().split()))
D=[0]

for l in L:
    D.append(D[-1]+l)

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

Submission status: Accepted

Solution code:
#
import itertools
from collections import Counter
from collections import defaultdict
import bisect
from heapq import heappush, heappop

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

print(ans + 1)

Submission status: Accepted

Solution code:
#!/usr/bin/env python
from __future__ import division, print_function

import os
import sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip

import random
import collections
import math
import itertools
import bisect

def real_main():
    n, x = read_int_array()
    ls = read_int_array()
    ans = 1
    pos = 0
    for d in ls:
        pos += d
        if pos <= x:
            ans += 1
        else:
            break
    print(ans)



def solve():
    pass


def main():
    if False and 'PYCHARM_HOSTED' in os.environ:
        main_pycharm()
    else:
        real_main()


from copy import deepcopy
def main_pycharm():
    solution = solve

    test_inputs = None
    test_outputs = None
    judge = None
    slow_solution = None
    if solution is not None:
        if test_outputs is not None:
            test_with_answers(solution, test_inputs, test_outputs)
        if judge is not None:
            test_with_judge(solution, test_inputs, judge)
        if slow_solution is not None:
            test_with_slow_solution(solution, test_inputs, slow_solution)


def test_with_answers(solution, inputs_answers):
    total, wrong = 0, 0
    for args, test_ans in inputs_answers:
        ans = solution(*args.copy())
        if ans != test_ans:
            print('WRONG! ans=%s, test_ans=%s, args=%s' % (ans, test_ans, args))
            wrong += 1
        else:
            print('GOOD')
        total += 1
    print('ALL %d TESTS PASSED' % total if not wrong else '%d out of %d tests are WRONG' % (wrong, total))


def test_with_judge(solution, inputs_gen, judge):
    total, wrong = 0, 0
    for args in inputs_gen:
        ans = solution(*deepcopy(args))
        if not judge(deepcopy(ans), *deepcopy(args)):
            print('WRONG! ans=%s, args=%s' % (ans, args))
            wrong += 1
        total += 1
    print('ALL %d TESTS PASSED' % total if not wrong else '%d out of %d tests are WRONG' % (wrong, total))


def test_with_slow_solution(solution, inputs_gen, solution_slow):
    total, wrong = 0, 0
    for args in inputs_gen:
        ans = solution(*deepcopy(args))
        slow = solution_slow(*deepcopy(args))
        if ans != slow:
            print('WRONG! ans=%s, slow=%s, args=%s' % (ans, slow, args))
            wrong += 1
        total += 1
    print('ALL %d TESTS PASSED' % total if not wrong else '%d out of %d tests are WRONG' % (wrong, total))


# region fastio

BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()


if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

input = lambda: sys.stdin.readline().rstrip("\r\n")

def read():
    return input()

def read_int():
    return int(input())

def read_array(sep=None, maxsplit=-1):
    return input().split(sep, maxsplit)

def read_int_array():
    return [int(a) for a in read_array()]

# endregion

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
from itertools import accumulate
INF = float("inf")


def solve(N: int, X: int, L: "List[int]"):
    D = [0]+list(accumulate(L))
    count = 0
    for d in D:
        if d <= X:
            count += 1
    print(count)
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    X = int(next(tokens))  # type: int
    L = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, X, L)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
nl = lambda: list(map(int, input().split()))
sl = lambda: input().split()
n = lambda: int(input())
s = lambda: input()

N, X = nl()
Ls = nl()

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

def main():
    N, X = LI()
    L = LI()
    ans = 1
    d = 0
    for l in L:
        d += l
        if d > X:
            break
        ans += 1
    return ans

print(main())

Submission status: Accepted

Solution code:
N, X = map(int, input().split())
ans = 1
now = 0
for l in map(int, input().split()):
    now += l
    if now <= X:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
import bisect
import os
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import string
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")

# X, A = list(map(int, sys.stdin.readline().split()))
# if X < A:
#
#     print(0)
# else:
#     print(10)


N, X = list(map(int, sys.stdin.readline().split()))
L = list(map(int, sys.stdin.readline().split()))
L = np.array(L)

cs = L.cumsum()
print((cs <= X).sum() + 1)

Submission status: Accepted

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

#A
def A():
    x,n = LI()
    if x < n:
        print(0)
    else:
        print(10)
    return

#B
def B():
    n,x = LI()
    l = LI()
    d = 0
    ans = 1
    for i in range(n):
        d += l[i]
        if d <= x:
            ans += 1
    print(ans)
    return

#C
def C():
    n = I()

    return

#D
def D():
    n = I()

    return

#E
def E():
    n = I()

    return

#F
def F():
    n = I()

    return

#Solve
if __name__ == "__main__":
    B()

Submission status: Accepted

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

Submission status: Accepted

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

print(num)

Submission status: Accepted

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

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 998244353
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
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 pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)

def main():
    n,x = LI()
    a = LI()
    r = 1
    t = 0
    for c in a:
        t += c
        if t <= x:
            r += 1

    return r


print(main())

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python

from collections import deque
import itertools as ite
import sys
import math

sys.setrecursionlimit(1000000)

INF = 10 ** 18
MOD = 10 ** 9 + 7

N, X = map(int, raw_input().split())
L = map(int, raw_input().split())
ans = 1
cur = 0
for num in L:
    cur += num
    if cur <= X:
        ans += 1
print ans

Submission status: Accepted

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

p = [0]
for i in l:
    p.append(p[-1] + i)

res = 0
for i in p:
    if i <= x:
        res += 1
print(res)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

print(ans)

Submission status: Runtime Error

Solution code:
#ABC130 B

N,X = map(int,input().split())
L = list(map(int,input().split()))
D = [0]
count = 0
for i in range(1,N+10):
    D.append(D[i-1]+L[i-2])
    if D[i]<= X:
        count += 1

print(count + 1)

Submission status: Runtime Error

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

cn = 0
ANS = 1

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# nは跳ねる回数　d1 = 1 dn+1 = dn + ln

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

d = 1
count = 1

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math
n,x = map(int,input().split())
l = list(map(int,input().split()))
d = [0]
for i in range(1, n+2):
    d.append(d[i-1] + l[i -1])
    if d[i] <= x:
        continue
    else:
        print(i)
        exit()

Submission status: Runtime Error

Solution code:
import math
n,x = map(int,input().split())
l = list(map(int,input().split()))
d = [0]
for i in range(1, n+2):
    d.append(d[i-1] + l[i -1])
    if x < d[i]:
        print(i)
        exit()
    else:
        continue

Submission status: Runtime Error

Solution code:
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = 0
d = 0
i = 0
while d <= a[1]:
  d += b[i]
  c += 1
  i += 1
print(c)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b=input().split()
a=int(a)
b=int(b)
c=list(map(int,input().split()))
d=0
for i in range(a):
  while d<b:
    d=d+b[i]
  print(d)
  break

Submission status: Runtime Error

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

pos = 0
index = 0
while pos < x:
    pos += l[index]
    index += 1
print(index)

Submission status: Runtime Error

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

pos = 0
index = 0
while pos <= x:
    pos += l[index]
    index += 1
print(index)

Submission status: Runtime Error

Solution code:
n,k=map(int,input().split())
s=0
l=list(map(int,input().split()))
c=0
i=0
while(s<=k):
    s+=l[i]
    i+=1
    c+=1
print(c)

Submission status: Runtime Error

Solution code:
n,k=map(int,input().split())
s=0
l=list(map(int,input().split()))
c=0
i=0
while(s<=k):
    s+=l[i]
    i+=1
    c+=1
print(c)

Submission status: Runtime Error

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

    while True:
        if D > X:
            cnt -= 1
            break
        if cnt > N + 1:
            cnt -= 1
            break
        D += L[cnt - 1]
        cnt += 1

    print(cnt)


if __name__ == "__main__":
    main()

Submission status: Runtime Error

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

ans=1
d=0

for i in a:
  d+=i
  if d>x:
    break
  ans+=1
  
print(ans)

Submission status: Runtime Error

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

print(N)

Submission status: Runtime Error

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

if D[N] < X:
  print(N+1)
else:
  p = 0
  a = D[p]
  while a <= X:
    p += 1
    a = D[p]
  print(p)

Submission status: Runtime Error

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

p = 0
a = D[p]
while a <= X:
  p += 1
  a = D[p]
else:
  break

print(p)

Submission status: Runtime Error

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

p = 0
a = D[p]
while a <= X:
  p += 1
  a = D[p]

print(p)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate, product # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
# my_round_int = lambda x:np.round((x*2 + 1)//2)
# 四捨五入g
import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
n,x = readInts()
L = readInts()
cnt = 0
now = 0
while now <= x:
    cnt += 1
    now += L[cnt-1]
print(cnt)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N, X = map(int, input().split())
*L, = map(int, input().split())
ans = 0
d = 0
while ans < N and d <= X:
    ans += 1
    d += L[ans]
if d <= X:
    ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
N, X = map(int, input().split())
*L, = map(int, input().split())
ans = 0
d = 0
while d <= X:
    d += L[ans]
    ans += 1
print(ans)

Submission status: Runtime Error

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

bnd = [0]

for i in range(N):
  bnd.append(bnd[i]+L[i])

i = 0
while bnd[i] <= X:
  i += 1
print(i)

Submission status: Runtime Error

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

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

print(ans)

Submission status: Runtime Error

Solution code:
n, x = list(map(int, input().split()))
l = list(map(int, input().split()))
d = 0
b = 0
while d <= x and b <= n + 1:
    d += l[b]
    b += 1
print(b)

Submission status: Runtime Error

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

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


def main():
    ans = X // L
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

sum=0
for i in range(N-1):
    sum += l[i]
    if sum>X:
        ans = i+1
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

sum=0
for i in range(N+1):
    sum += l[i]
    if sum>X:
        ans = i+1
print(ans)