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:
import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
ra = range
enu = enumerate


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_tuple(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_col(H):
    '''
    H is number of rows
    A列、B列が与えられるようなとき
    ex1)A,B=read_col(H)    ex2) A,=read_col(H) #一列の場合
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return tuple(map(list, zip(*ret)))


def read_matrix(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため


MOD = 10**9 + 7
INF = 2**31  # 2147483648 > 10**9
# default import
from collections import defaultdict, Counter, deque
from operator import itemgetter
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  # , insort_left, insort_right

# https://atcoder.jp/contests/abc130/tasks/abc130_b
# 愚直にシミュレーションしてみれば良い
N, X = read_ints()
L = read_ints()
cnt = 1
d = 0
for l in L:
    # print(cnt, d)
    cnt += 1
    d += l
    if d > X:  # 初めて条件が満たさなくなったときにbreak
        break
print(cnt - 1)

Submission status: Wrong Answer

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

count=0
dist=0

i=0
while dist<=X and i<=N-1:
    count+=1
    dist+=L[i]
    i+=1
    #print(dist)

print(count)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
ra = range
enu = enumerate


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_tuple(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_col(H):
    '''
    H is number of rows
    A列、B列が与えられるようなとき
    ex1)A,B=read_col(H)    ex2) A,=read_col(H) #一列の場合
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return tuple(map(list, zip(*ret)))


def read_matrix(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため


MOD = 10**9 + 7
INF = 2**31  # 2147483648 > 10**9
# default import
from collections import defaultdict, Counter, deque
from operator import itemgetter
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  # , insort_left, insort_right

# https://atcoder.jp/contests/abc130/tasks/abc130_b
# 愚直にシミュレーションしてみれば良い
N, X = read_ints()
L = read_ints()
cnt = 0
d = 0
for l in L:
    if d > X:
        break
    cnt += 1
    d += l
print(cnt)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
ra = range
enu = enumerate


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_tuple(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_col(H):
    '''
    H is number of rows
    A列、B列が与えられるようなとき
    ex1)A,B=read_col(H)    ex2) A,=read_col(H) #一列の場合
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return tuple(map(list, zip(*ret)))


def read_matrix(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため


MOD = 10**9 + 7
INF = 2**31  # 2147483648 > 10**9
# default import
from collections import defaultdict, Counter, deque
from operator import itemgetter
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  # , insort_left, insort_right

# https://atcoder.jp/contests/abc130/tasks/abc130_b
# 愚直にシミュレーションしてみれば良い
N, X = read_ints()
L = read_ints()
cnt = 0
d = 0
for l in L:
    cnt += 1
    d += l
    if d > X:
        break
print(cnt)

Submission status: Wrong Answer

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

point = 0
ans = 0
for l in L:
    point += l
    ans += 1
    if point > x:
        break
print(ans)

Submission status: Wrong Answer

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

print(m)

Submission status: Wrong Answer

Solution code:

N,X = map(int,input().split())
L = list(map(int,input().split()))
counter = 0
total = 0
for l in L:
    if(total <=X):counter+=1
    total+=l
print(counter)

Submission status: Wrong Answer

Solution code:
n,x = map(int,input().split())
l = list(map(int,input().split()))
m = 0
a = 0
while(a<=x):
    a+=l.pop(0)
    m+=1
    if l==[]:
        m=n
        break
print(m)

Submission status: Wrong Answer

Solution code:
n,x = map(int,input().split())
l = list(map(int,input().split()))
m = 0
a = 0
while(a<=x):
    a+=l.pop(0)
    m+=1
    if l==[]:
        break
print(m)

Submission status: Wrong Answer

Solution code:
n,x = map(int,input().split())
l = list(map(int,input().split()))
m = 0
a = 0
while(a<=x):
    a+=l.pop(0)
    m+=1
    if l!=[]:
        break
print(m)

Submission status: Wrong Answer

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

from itertools import groupby, accumulate, product, permutations, combinations
def solve(N,X,L):
    L = accumulate(L)
    ans = 1
    for i,l in enumerate(L):
        if l>X:
            ans += i
            break
    return ans
print(solve(N,X,L))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N, X = lr()
L = lr()
cnt = 0
cur = 0
for l in L:
    cnt += 1
    cur += l
    if cur > X:
        break

answer = cnt
print(answer)

Submission status: Wrong Answer

Solution code:
import sys
from math import ceil, floor, sqrt, sin, cos, pi
from itertools import accumulate, permutations, combinations
from fractions import gcd # 最大公約数
from collections import deque, Counter
from operator import itemgetter
from heapq import heappop,heappush
sys.setrecursionlimit(10**7)
def lcm(x, y): return ((x * y) // gcd(x, y)) # 最小公倍数
# list(map(int, input().split()))
# map(int, input().split())
# int(input())
# input().split()
# mojiretu = ','.join(str_list)
# sorted(input())

n, x = map(int, input().split())
a = list(map(int, input().split()))
ans = 0
now = 0
for i in a:
    if now > x:
        print(ans)
        sys.exit()
    now += i
    ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
n,x=map(int,input().split())
listl=list(map(int,input().split()))
sum=0
count=0
for k in range(2,n+1):
  sum+=listl[k-2]
  if sum<=x:
    count+=1
print(count+1)

Submission status: Wrong Answer

Solution code:
n,x=map(int,input().split())
listl=list(map(int,input().split()))
sum=0
for k in range(2,n+1):
  while sum<=x:
    sum+=listl[k-2]
print(k)

Submission status: Wrong Answer

Solution code:
n,x=map(int,input().split())
listl=list(map(int,input().split()))
sum=0
for k in range(2,n+1):
  while sum<=x:
    sum+=listl[k-2]
print(k-1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def q2():
    N, X = (int(i) for i in input().split())
    l = [int(i) for i in input().split()]
    L = [0]
    for i in range(N):
        L.append(l[i])

    sum_L = L[0]
    if sum_L >= X:
        print(1)
        return

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

    print(ans)


if __name__ == '__main__':
    q2()

Submission status: Wrong Answer

Solution code:
def q2():
    """B - Bounding"""
    N, X = (int(i) for i in input().split())
    l = [int(i) for i in input().split()]
    L = [0]
    for i in range(N):
        L.append(l[i])

    sum_L = L[0]
    if sum_L >= X:
        print(1)
        return

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

    print(ans)


if __name__ == '__main__':
    q2()

Submission status: Wrong Answer

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

    ans = 0
    sum_L = 0

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

    print(ans)


if __name__ == '__main__':
    q2()

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

Submission status: Wrong Answer

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

d = 0
count = 0

#跳ねる直前からスタート

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

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

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

ans = 1
bound = 0

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

print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

p = 0
i = 0
ans = 0

while p <= X and i < len(L):
    p += L[i]
    i += 1
    ans += 1
print(ans)

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(hane)

Submission status: Wrong Answer

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

print(hane)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# ABC 130: B – Bounding
N, X = map(int, input().split())
L = [int(s) for s in input().split()]

counter = 0
bounding = 0

for l in L:
    if bounding > X:
        break
    
    counter += 1
    bounding += l

print(counter)

Submission status: Wrong Answer

Solution code:
n, x= input().split()
n, x= int(n), int(x)
lista=[]
sum=0

for x in input().split():
	x= int(x)
	lista.append(x)

cont=1
for i in range(n):
	sum+=lista[i]
	if sum <= x:
		cont+=1
print(cont)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
icase=0
if icase==0:
    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
    if d<=x:
        print(n)

Submission status: Wrong Answer

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

for i in range(1, n + 1):
    D[i] = D[i - 1] + L[n - 1]

    if D[i] <= x:
        ans = ans + 1
    else:
        break

print(ans)

Submission status: Wrong Answer

Solution code:
def main():
    n, x = [int(z) for z in input().split()]
    l = [int(z) for z in input().split()]
    tam = len(l)
    d = 0
    for i in range(tam):
        d += l[i]
        if d > x:
            print(i + 1)
            break
main()

Submission status: Wrong Answer

Solution code:
def function(N, L, X):
    D = [0]
    for i in range(1, N+1):
        D.append(D[i-1]+L[i-1])
        if D[-1] > X:
            return i

line = input()
N, X = [int(n) for n in line.split()]
line = input()
L = [int(n) for n in line.split()]
print(function(N, L, X))

Submission status: Wrong Answer

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

    else:
        break

print(counter)

Submission status: Wrong Answer

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

print(counter)

Submission status: Wrong Answer

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

print(counter)

Submission status: Wrong Answer

Solution code:
n,x= input().split()
b_list= list(map(int, input().split()))
temp = 0
counter = 0
for i in b_list:
    if (temp<=int(x)):
        counter +=1
    temp += i

print(counter)

Submission status: Wrong Answer

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

SUM = 0
cnt = 1
for i in l:
    SUM += i
    if SUM > x:
        print(cnt)
        exit()
    cnt += 1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

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


d = 0

count = 0


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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,X=map(int, input().split())
L=list(map(int, input().split()))
count = 0
x=0
# X=6
while x <= X and count < N:
  x = x + L[count]
  count = count + 1
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b = list(map(int,input().rstrip().split()))
t  =list(map(int,input().rstrip().split()))
m = 0
for i in range(a):
  m = m + t[i]
  if m > b:
    print(i+1)
    break
  elif m == b:
    print(i+2)
    break

Submission status: Wrong Answer

Solution code:
a,b = list(map(int,input().rstrip().split()))
t  =list(map(int,input().rstrip().split()))
m = 0
for i in range(a):
  m = m + t[i]
  if m > b:
    print(i+1)
    break

Submission status: Wrong Answer

Solution code:
a,b = list(map(int,input().rstrip().split()))
t  =list(map(int,input().rstrip().split()))
m = 0
for i in range(a):
  m = m + t[i]
  if m > b:
    print(i)
    break

Submission status: Wrong Answer

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

ans = 1
d = 0
for x in L:
    d += d + x
    if d <= X :
        ans += 1

print(ans)

Submission status: Wrong Answer

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

ans = 1
d = 0
for j in range(n):
    d += d + L[j]
    if d <= x :
        ans += 1

print(ans)

Submission status: Wrong Answer

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

ans = 1
sum_L = 0
for j in range(n):
    sum_L += sum_L + L[j]
    if sum_L <= x :
        ans += 1
    else :
        exit(0)
        print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

ans = 0
new_list = [0]
for i in range(n[0] - 1):
  ans = ans + m[i]
  if ans <= n[1]:
    new_list.append(ans)
  elif ans > n[1]:
    break
    
print(len(new_list))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

x = 0
number_of_bounds = 0
for _i, Li in enumerate(L):
    number_of_bounds = _i + 1
    x += Li
    if x > X: break
    
print(number_of_bounds)

Submission status: Wrong Answer

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

x = 0
number_of_bounds = 0
for _i, Li in enumerate(L):
    x += Li
    number_of_bounds = _i + 1
    if x > X: break
    
print(number_of_bounds)

Submission status: Wrong Answer

Solution code:
# Di−1+Li−1(2≤i≤N+1)

# Di−1+Li−1(2≤i≤N+1) 
inputted = list(map(int, input().split()))
N = inputted[0]
X = inputted[1]
L = list(map(int, input().split()))

x = 0
number_of_bounds = 0
for _i, Li in enumerate(L):
    x += Li
    if x > X:
        number_of_bounds = _i + 1
        break
    
print(number_of_bounds)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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]
	cnt += 1
	if x < d:
		print(cnt)
#print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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