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

input = lambda: sys.stdin.readline().rstrip()


def solve():
    N, X = map(int, input().split())
    L = list(map(int, input().split()))
    lsum = [0 for _ in range(N + 1)]
    for i in range(N):
        lsum[i + 1] = L[i] + lsum[i]

    for i in range(N):
        if lsum[i] <= X:
            ans = i + 1
        else:
            break
    print(ans)


if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
N,X=map(int, input().split())
List=list(map(int, input().split()))
i=0
bow=0
while bow<=X and i<N:
    bow+=List[i]
    i+=1
print(i)

Submission status: Wrong Answer

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n,x = map(int, raw_input().split(' '))
ais = map(int, raw_input().split(' '))
count,cur,i = 0,0, 0
while(cur <= x and i < len(ais)):
  count +=1
  cur += ais[i]
  i +=1
print count

Submission status: Wrong Answer

Solution code:
# 初期入力
import sys
input = sys.stdin.readline
N,X = (int(x) for x in input().split())
L = list(map(int, input().split()))
d =[0]*(N+1)
count =1
for i in range(N):
    d[i+1] =d[i] +L[i]
    if d[i+1] < X:
        count +=1
    else:
        break
print(count)

Submission status: Wrong Answer

Solution code:
from sys import stdin, setrecursionlimit


def main():
    input = stdin.buffer.readline
    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 = i + 1
            break
    print(ans)


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()

Submission status: Wrong Answer

Solution code:
from sys import stdin, setrecursionlimit


def main():
    input = stdin.buffer.readline
    n, x = map(int, input().split())
    l = list(map(int, input().split()))

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


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()

Submission status: Wrong Answer

Solution code:
from sys import stdin, setrecursionlimit


def main():
    input = stdin.buffer.readline
    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()


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(n+1):
  if ln[i]>x:
    print(i)
    exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
abc = [int(e) for e in input().split()]
length = [int(e) for e in input().split()]

N = abc[0]
X = abc[1]

total_length = 0
count = 1

for i in range(len(length)):
    if total_length > X:
        count = count - 1
        break
    total_length = total_length + length[i]
    count = count + 1


if count > (N+1):
    print(N+1)
else:
    print(count)

Submission status: Wrong Answer

Solution code:
abc = [int(e) for e in input().split()]
length = [int(e) for e in input().split()]

N = abc[0]
X = abc[1]

total_length = 0
count = 1

for i in range(len(length)):
    if total_length > X:
        count = count - 1
        break
    total_length = total_length + length[i]
    count = count + 1


if count > N:
    print(N)
else:
    print(count)

Submission status: Wrong Answer

Solution code:
abc = [int(e) for e in input().split()]
length = [int(e) for e in input().split()]

N = abc[0]
X = abc[1]

total_length = 0
count = 1

for i in range(len(length)):
    if total_length > X:
        break
    total_length = total_length + length[i]
    count = count + 1

count = count - 1

if count > N:
    print(N)
else:
    print(count)

Submission status: Wrong Answer

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

sum = 0

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

Submission status: Wrong Answer

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

sum = 0

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

Submission status: Wrong Answer

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

ans = 1
r = 0
for l in L:
    r += l
    if x < r:
        print (ans)
        exit ()
    else:
        ans += 1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
abc = [int(e) for e in input().split()]
length = [int(e) for e in input().split()]

N = abc[0]
X = abc[1]

total_length = 0
count = 0

for i in range(len(length)):
    if total_length > X:
        break
    total_length = total_length + length[i]
    count = count + 1

if count > (N + 1):
    print(N+1)
else:
    print(count)

Submission status: Wrong Answer

Solution code:
abc = [int(e) for e in input().split()]
length = [int(e) for e in input().split()]

N = abc[0]
X = abc[1]

total_length = 0
count = 0

for i in range(len(length)):
    if total_length > X:
        break
    total_length = total_length + length[i]
    count = count + 1

if count > N:
    print(N)
else:
    print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(1,n+1):
  tmp = bound[i-1] + l[i-1]
  bound.append(tmp)
#bound.sort()
ans = 0
for i in range(0,n):
  if(bound[i] <= x):
    ans += 1
  else:
    break
print(ans)

Submission status: Wrong Answer

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

for i in range(1,n+1):
  tmp = bound[i-1] + l[i-1]
  bound.append(tmp)
bound.sort()
ans = 0
for i in range(0,n):
  if(bound[i] <= x):
    ans += 1
  else:
    break
print(bound)

Submission status: Wrong Answer

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

for i in range(1,n+1):
  tmp = bound[i-1] + l[i-1]
  bound.append(tmp)
#bound.sort()
ans = 0
for i in range(0,n):
  if(bound[i] <= x):
    ans += 1
  else:
    break
print(bound)

Submission status: Wrong Answer

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

for i in range(1,n+1):
  tmp = bound[i-1] + l[i-1]
  bound.append(tmp)
bound.sort()
ans = 0
for i in range(0,n):
  if(bound[i] <= x):
    ans += 1
  else:
    break
print(ans)

Submission status: Wrong Answer

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

for i in range(1,n):
  tmp = bound[i-1] + l[i]
  bound.append(tmp)
bound.sort()
ans = 0
for i in range(0,n):
  if(bound[i] <= x):
    ans += 1
  else:
    break
print(ans)

Submission status: Wrong Answer

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

n,x = intMap()
l = intList()

d = 0
i = 0

while d <= x:
    d = d + l[i]
    i += 1
    if i >= n: break

# ans = min(i,n)
print(i)

Submission status: Wrong Answer

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

n,x = intMap()
l = intList()

d = 0
i = 0

while d <= x:
    d = d + l[i]
    i += 1
    if i >= n: break

ans = min(i,n)
print(ans)

Submission status: Wrong Answer

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

n,x = intMap()
l = intList()

d = 0
bound = 0

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


print(bound)

Submission status: Wrong Answer

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

dis=0

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

Submission status: Wrong Answer

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


def main():
    N, X = map(int, input().split())
    L_list = list(map(int, input().split()))
    D = 0
    ans = 0
    for n in range(N):
        if D <= X:
            ans += 1
            D += L_list[n]
        else:
            break
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from sys import stdin

n, x = map(int, stdin.readline().split())
count = 1
num = 0

l = list(map(int, stdin.readline().split()))

for i in l:
  num += i
  if(num > x):
    print(count)
    break
  else:
    count += 1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,x=map(int,input().split())
l=list(map(int,input().split()))
temp=[0]*(n+1)
for i in range(0,n):
  temp[i+1]=temp[i]+l[i]
import bisect
print(bisect.bisect_left(temp,x))

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
L = list(map(int,input().split()))
c=0
d=0

for i in range(a):
  if d <= b:
    c = c+1
    d = d+L[i]
print(c)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

count = 1
check = 0
for i in range(n):
    check += i
    if check <= 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()))

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

Submission status: Wrong Answer

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

d = [0]
total = 0
for i in range(n):
  total += l[i]
  d.append(total)

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

Submission status: Wrong Answer

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

d = [0]
total = 0
for i in range(n):
  total += l[i]
  d.append(total)
  
for i in range(n):
  if x < l[i]:
    print(i)
    quit()

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])
  if d[i+1]>x:
    break

print(len(d)-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import itertools
import math
import fractions
import functools
import copy

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

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

l=[int(x) for x in input().split()]
d=0
cnt=1
for i in l:
    d+=i
    cnt+=1
    if d >x:
        print(cnt-1)
        break
    elif d==x:
        print(cnt)
        break

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Tue May 12 00:21:28 2020

@author: shinba
"""

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

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

i = 0
ans = 0

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Tue May 12 00:21:28 2020

@author: shinba
"""

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

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

i = 0
ans = 0

for j in range(n):
    if i <= x:
        ans += 1
        i += L[j]
        continue
    else:
        break

print(ans)

Submission status: Wrong Answer

Solution code:
def main():
    N, X = (int(x) for x in input().split())
    L = [int(x) for x in input().split()]
    D = [0]

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

    print(len(D))


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

cnt =1
now = 0
for i in range(len(l)):
    now += l[i]
    if now <=x:
        cnt+=1
    else:
        print(cnt)
        exit(0)

Submission status: Wrong Answer

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

cnt=0
for i, li in enumerate(l):
    cnt += li
    if cnt > x:
        print(i+1)
        break

Submission status: Wrong Answer

Solution code:
import bisect

N, X = map(int, input().split())
L = [0]+list(map(int, input().split()))

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

print(bisect.bisect_right(L, X))

Submission status: Wrong Answer

Solution code:
import bisect

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

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

print(bisect.bisect_right(L, X))

Submission status: Wrong Answer

Solution code:
N, X = map(int,input().split())
L = list(map(int,input().split()))
D = list()
D.append(0)
count = 1
Dplus=0
for i in range(1,N):
    Dplus=D[i-1]+L[i-1]
    D.append(Dplus)
    #print(D[i])
    if D[i]<=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()))
D = list()
D.append(0)
count = 1
for i in range(1,N):
    Dplus=D[i-1]+L[i-1]
    D.append(Dplus)
    #print(D[i])
    if D[i]<=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()))
D = list()
D.append(0)
count = 1
for i in range(1,N):
    Dplus=D[i-1]+L[i-1]
    D.append(Dplus)
    #print(D[i])
    if D[i]<=X:
        count+=1
    else:
        count+=0
print(count)

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 L:
    if tmp<=X:
        ans += 1
        tmp += i
    else:
        break

print(ans)

Submission status: Wrong Answer

Solution code:
# B - Bounding

N, X = map(int, input().split())
L = [int(l) for l in input().split()]
D = 0
cnt = 0
for i in range(N):
    if D <= X:
        cnt += 1
    D = D + L[i]

print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

position=0
cnt=1

for i in range(N):
    position+=Llist[i]
    if position < X:
        cnt+=1

print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import bisect as bi
I=lambda:list(map(int,input().split()))
n,x=I()
l=I()
ans=0
t=0
for i in range(1,n):
  l[i]+=l[i-1]
an=bi.bisect(l,x)
print(an)

Submission status: Wrong Answer

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

d = 0
count = 0
i = 1
while d <= x and i <= n:
    d = d + l[i - 1]
    count += 1
    i += 1
if d < x:
    count += 1

print(count)

Submission status: Wrong Answer

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

d = 0
count = 0
i = 1
while d <= x and i <= n:
    d = d + l[i - 1]
    count += 1
    i += 1

print(count)

Submission status: Wrong Answer

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

d = 0
count = 0
i = 1
while d <= x:
    d = d + l[i - 1]
    count += 1
    if i <= n - 1:
        i += 1
    else:
        break

print(count)

Submission status: Wrong Answer

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

d = 0
count = 0
i = 1
while d <= x:
    d = d + l[i - 1]
    count += 1
    if i <= n - 1:
        i += 1

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Sum=0
Count=0
while Sum<=X:
    Sum+=L[Count]
    Count+=1
    if Count==N:
        Count=N+1
        break
    
print(Count)

Submission status: Wrong Answer

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

Sum=0
Count=0
while Sum<=X:
    Sum+=L[Count]
    Count+=1
    if Count==N:
        Count=N+2
        break
    
print(Count)

Submission status: Wrong Answer

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

Sum=0
Count=0
while Sum<=X:
    Sum+=L[Count]
    Count+=1
    if Count==N:
        Count==N+1
        break
    
print(Count)

Submission status: Wrong Answer

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

Sum=0
Count=0
while Sum<=X:
    Sum+=L[Count]
    Count+=1
    if Count==N:
        Count==N+2
        break
    
print(Count)

Submission status: Wrong Answer

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

for i in range(n):
	if D <= x:
		c += 1
	D += L[i]
print(c)

Submission status: Wrong Answer

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

for i in L:
  if p > X:
    print(count)
    quit()
  count += 1
  p += i

Submission status: Wrong Answer

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

for i in L:
  if p > X:
    break
  else:
  	count += 1
  	p += i

print(count)

Submission status: Wrong Answer

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

for i in L:
  if p > X:
    break
  count += 1
  p += i

print(count)

Submission status: Wrong Answer

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

D = [0] * (N+2)
for i in range(2, N+2):
    D[i] = D[i-1] + L[i-2]
    if D[i] > X:
        ans = i-1
        break

if D[-1] <= X:
    ans = N+1

print(ans)

Submission status: Wrong Answer

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

D = [0] * (N+2)
for i in range(2, N+2):
    D[i] = D[i-1] + L[i-2]
    if D[i] > 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
c = 1
for i in l:
    d += i
    if(c <= x):c += 1
    else:break
print(c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,x=map(int,input().split())
s=list(map(int,input().split()))
t=sum(s)
b,c=0,0
while b<=x and len(s)>0:
    c+=1
    b+=s[0]
    del s[0]
if t==b:
    print(n+1)
else:
    print(c)

Submission status: Wrong Answer

Solution code:
n,x=map(int,input().split())
s=list(map(int,input().split()))
b,c=0,0
while b<=x and len(s)>0:
    c+=1
    b+=s[0]
    del s[0]
print(c)

Submission status: Wrong Answer

Solution code:
n,x=map(int,input().split())
s=list(map(int,input().split()))
b,c=0,0
while b<=x and len(s)>0:
    c+=1
    b+=s[0]
    del s[0]
print(c)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
line = input()
num = (int)(line.split(" ")[0])
limit = (int)(line.split(" ")[1])

x = 0
count = 0
line = input()
for i in range(num):
  if x > limit:
    break
  x += (int)(line.split(" ")[i])
  count += 1
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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 count<=N:
    count+=1
    dist+=L[i]
    #print(dist)

print(count)

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)