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

Submission status: Accepted

Solution code:
N, X = map(int, input().split())
L = [int(s) for s in input().split()]
ans = 1
d = 0
for l in L:
    d += l
    if d > X:
        print(ans)
        exit()
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
n, x = map(int, input().split())
l = list(map(int, input().split()))
b = 0
ans = 1
for i in l:
    b = b + i
    if b <= x:
        ans = 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 if D <= X else 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
counter = 1
for l in L:
    d += l
    if d <= X:
        counter += 1
    else:
        break
print(counter)

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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



x = 0
cnt = 0
if x <= X:
    cnt += 1

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

print(cnt)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
n, x = map(int, input().split())
curr = 0
res = 1
for e in map(int, input().split()):
    curr += e
    if curr > x:
        break
    res += 1

print(res)

Submission status: Accepted

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

print(cnt+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve(N, X, L):
    x = 0
    c = 1
    for l in L:
        x += l
        if x > X:
            break
        c += 1
    return c

def main():
    N, X = [int(x) for x in input().split()]
    L = [int(x) for x in input().split()]
    print(solve(N, X, L))
    pass
main()

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
import sys
from collections import deque  # 双方向キュー
from collections import defaultdict  # 初期化済み辞書
from heapq import heapify, heappush, heappop, heappushpop  # プライオリティキュー
from bisect import bisect_left, bisect_right  # 二分探索
#import numpy as np  # 1.8.2
#import scipy  # 0.13.3

s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in ss]
ss2nnn = lambda ss: [s2nn(s) for s in ss]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [sys.stdin.readline().rstrip() for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))

def main():
    N, X = i2nn()
    L = i2nn()
    c = 1
    p = 0
    for l in L:
        p += l
        if p <= X:
            c += 1
        else:
            break
    print(c)

main()

Submission status: Accepted

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

Submission status: Accepted

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

pre = 0
ans = 1

for l in L:
    temp = pre + l
    if x >=  temp:
        ans += 1
    pre = temp
print(ans)

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

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

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

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 = count + 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

d = 0
count = 1
for l in l_list:
    d = d + l
    if d > x:
        break
    count = count + 1

print(count)

Submission status: Accepted

Solution code:
import math
import copy
from operator import mul
from functools import reduce
from collections import defaultdict
from collections import Counter
from collections import deque
# 直積 A={a, b, c}, B={d, e}:のとき，A×B={(a,d),(a,e),(b,d),(b,e),(c,d),(c,e)}: product(A, B)
from itertools import product
# 階乗 P!: permutations(seq), 順列 {}_len(seq) P_n: permutations(seq, n)
from itertools import permutations
# 組み合わせ {}_len(seq) C_n: combinations(seq, n)
from itertools import combinations
# 一次元累積和
from itertools import accumulate
from bisect import bisect_left, bisect_right

# import numpy as np
# from scipy.special import perm
# from scipy.special import comb

def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W

# 四方向: 右, 下, 左, 上
dy = [0, -1, 0, 1]
dx = [1, 0, -1, 0]
 
def i_inpl(): return int(input())
def l_inpl(): return list(map(int, input().split()))
INF = float("inf")

########

N, X = l_inpl()
L = l_inpl()

cnt = 1
now = 0

for Li in L:
    now += Li
    # print(now)
    if now > X:
        break
    cnt += 1

print(cnt)

Submission status: Accepted

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

count = 1
d = 0
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()))
ans = 1
D = 0
for l in L:
    D = D + l
    if D > X:
        break
    ans += 1
print(ans)

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

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

count=1
now=0

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

print(count)

Submission status: Accepted

Solution code:
import collections
import itertools

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

d = 0
counter = 1

for l in L:
    d += l
    if (d <= X):
        counter += 1

print(counter)

Submission status: Accepted

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

print(len(D))

Submission status: Accepted

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

sumv = 0
cnt = 1
for l in L:
  sumv += l
  if sumv > X: break
  cnt += 1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
read = input 
rn = lambda :list(map(int, read().split()))
n,x = rn()
L = rn()
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 = list(map(int, input().split()))
ans = 1
tmp = 0
for i in l:
    tmp += i
    if tmp <= x:
        ans+=1
print(ans)








#        _           _              _       _
#       | |         | |            | |     (_)
#    ___| |__   ___ | | ___   _  __| | __ _ _
#   / __| '_ \ / _ \| |/ / | | |/ _` |/ _` | |
#  | (__| | | | (_) |   <| |_| | (_| | (_| | |
#   \___|_| |_|\___/|_|\_\\__,_|\__,_|\__,_|_|
#
#

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys


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


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
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:
n, x = (int(_) for _ in input().split())
bounce = [int(_) for _ in input().split()]
curr = 0
ans = 0
if curr <= x:
    ans += 1
for i in bounce:
    curr += i
    if curr <= x:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)
input = sys.stdin.readline


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


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, X, L):
    ans = 0
    D = 0
    for l in L:
        if D <= X:
            ans += 1
        D += l
    if D <= X:
        ans += 1

    return ans


def main():
    N, X = read_int_n()
    L = read_int_n()
    print(slv(N, X, L))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

Solution code:

n,x=map(int,input().split())
#n=int(input())
l=[0]+[int(i) for i in input().split()]
ans=0

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

c = 1
d = 0

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

print(c)

Submission status: Accepted

Solution code:
import sys
from operator import itemgetter

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

n, x = na()
li = na()
ct = 1
h = 0
for num in li:
    h += num
    if h <= x:
        ct += 1
print(ct)

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:
from itertools import accumulate

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

q = [0] + list(accumulate(L))
print(sum(1 for v in q if v <= X))

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 = d + l[i]
  if d<=x:
    ans+=1
print(ans)

Submission status: Accepted

Solution code:
def inverse(a):
    return pow(a, mod - 2, mod)


def usearch(x, a):
    lft = 0
    rgt = len(a) + 1
    while rgt - lft > 1:
        mid = (rgt + lft) // 2
        if a[mid] <= x:
            lft = mid
        else:
            rgt = mid
    return lft


def main():
    n,x=map(int, input().split())
    ans = 1
    s = 0
    for i in map(int, input().split()):
        s += i
        if s <= x:
            ans += 1
        else:
            break
    print(ans)


main()

Submission status: Accepted

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

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

ans = 0
a = 0
for i in L:
    if a <= x:
        ans += 1
    a += i

if a <= x:
    ans += 1

print(ans)

Submission status: Accepted

Solution code:
#!/usr/local/bin/python3
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    n,x = f()
    l = f()

    a = []
    a.append(0)

    for i in l:
        a.append(a[-1] + i)

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

solve()

Submission status: Accepted

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

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

Submission status: Accepted

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

import array
from bisect import *
from collections import *
import fractions
import heapq
from itertools import *
import math
import random
import re
import string
import sys

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

pos = 0
ans = 0

if pos <= X:
    ans += 1

for l in Ls:
    pos += l
    if pos <= X:
        ans += 1

print(ans)

Submission status: Accepted

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

    ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

cnt = 1
dist = 0

for l in L:
	dist += l
	if dist > X:
		break
	cnt += 1
print(cnt)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
n,x = map(int,input().split())
e = list(map(int,input().split()))
cn = 0
le = 0
for v in e:
    le += v
    if le > x:
        break
    else:
        cn += 1
print(cn + 1)

Submission status: Accepted

Solution code:
import sys
input=sys.stdin.readline
from collections import deque
from heapq import heappush,heappop
import re

def int_raw():
    return int(input())
 
def ss_raw():
    return input().split()
 
def ints_raw():
    return tuple(map(int, ss_raw()))


def mod_inv(a, b):
    r = a
    w = b
    u = 1
    v = 0
    while w != 0:
        t = r//w
        r -= t*w
        r, w = w, r
        u -= t*v
        u, v = v, u
    return (u % b+b) % b


DIV = 10**9+7

def ncr(n, r, mod=DIV):
	r = min(r, n-r)
	ret = 1
	for i in range(1, r+1):
		ret = ret * (n-i+1) % mod
		ret = ret * mod_inv(i, mod) % mod
	return ret


def main():
    ans =0
    N,X = ints_raw()
    Ls = ints_raw()
    D = 0
    for l in [0]+list(Ls):
        D+=l
        if D<=X:
            ans+=1
    return ans

print(main())

Submission status: Accepted

Solution code:
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys

mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000


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

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

print(cnt)

Submission status: Accepted

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

def ri():
    return int(input())

def rl():
    return list(input().split())

def rli():
    return list(map(int, input().split()))

def main():
    n, x = rli()
    ll = rli()
    ans = 1
    d = 0
    for l in ll:
        d += l
        if d <= x:
            ans += 1
    print(ans)



if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
# input = sys.stdin.readline
inf = 10 ** 18

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

D = 0
cnt = 1
for i, Li in enumerate(L):
    D += Li
    if D <= X: cnt += 1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    n, x = map(int, input().split())
    arr = map(int, input().split())
    ans = 1
    curr = 0
    for l in arr:
        curr += l
        if curr <= x:
            ans += 1
        else:
            break
    print(ans)
    return 0

main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

cnt = 1
now = 0
for y in l:
    now += y
    if now > x:
        break
    cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
from itertools import accumulate
N, X = map(int, input().split())
L = [0] + list(map(int, input().split()))
L = list(accumulate(L))
print(sum(1 for l in L if l <= X))

Submission status: Accepted

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

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

Submission status: Accepted

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

ans = 1
d = 0

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

print(n+1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from itertools import accumulate
from bisect import bisect_right

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

l = [0] + list(accumulate(L))
print(bisect_right(l, X))

Submission status: Accepted

Solution code:

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

Submission status: Accepted

Solution code:
n,x = map(int,input().split())
L = list(map(int,input().split()))
ans = 1
pos = 0
for l in L:
    pos += l
    if pos <= x:
        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: break
    ans += 1

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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


def LI(): return [int(x) for x in sys.stdin.readline().split()]


def SI(): return input()


def main():
    N, X = LI()
    L = LI()
    now = 0
    count = 1
    for l in L:
        now += l
        if now > X:
            break
        count += 1
    print(count)


main()

Submission status: Accepted

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, accumulate
from operator import itemgetter, mul
from copy import deepcopy
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()
L = LIST()

L = list(accumulate(L))

L.insert(0, 0)
# print(L)

ans = 0
for i in L:
	if i <= X:
		ans += 1
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print (count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, X = map(int, input().split())
L = [int(_) for _ in input().split()]
ans = 1
tmp = 0

for i in L:
    tmp += i
    if tmp <= X:
        ans += 1
    else:
        break

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

d = 0
ans = 1
for l in Ls:
    d += l
    if d <= X:
        ans+=1
print(ans)

Submission status: Accepted

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

cnt = 1
cur = 0
for i, LL in enumerate(L):
    cur += LL
    if cur <= X:
        cnt += 1
print(cnt)

Submission status: Accepted

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

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

n, x = map(int, input().split())
r = 0
s = 0
a = list(map(int, input().split()))
for l in a:
    s += l
    if s <= x:
        r += 1

print(r+1)

Submission status: Accepted

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

N, X = getlist()
L = getlist()

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:


def main():
    n, x = map(int, raw_input().split())
    ll = map(int, raw_input().split())
    d = 0
    ans = 1
    for l in ll:
        d += l
        if d <= x:
            ans += 1
        else:
            break
    print ans


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))

n,x = getList()
nums = getList()
ans = 1
tmp = 0
for num in nums:
    tmp += num
    if tmp<=x:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
#import sys
#input = sys.stdin.readline
def main():
    N, X = map( int, input().split())
    L = list( map( int, input().split()))
    ans = 1
    now = 0
    for i in range(N):
        now += L[i]
        if now > X:
            break
        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()))
a = 0
num = 1
for i in l:
  a += i
  if a <= x:
    num += 1
print(num)

Submission status: Accepted

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

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

print(cnt)