Problem:


Score : 200 points

Problem Statement

A ball will bounce along a number line, making N + 1 bounces. It will make the first bounce at coordinate D_1 = 0, and the i-th bounce (2 \leq i \leq N+1) at coordinate D_i = D_{i-1} + L_{i-1}.

How many times will the ball make a bounce where the coordinate is at most X?

Constraints

1 \leq N \leq 100

1 \leq L_i \leq 100

1 \leq X \leq 10000

All values in input are integers.

Input

Input is given from Standard Input in the following format:

N X
L_1 L_2 ... L_{N-1} L_N

Output

Print the number of times the ball will make a bounce where the coordinate is at most X.

Sample Input 1

3 6
3 4 5

Sample Output 1

2

The ball will make a bounce at the coordinates 0, 3, 7 and 12, among which two are less than or equal to 6.

Sample Input 2

4 9
3 3 3 3

Sample Output 2

4

The ball will make a bounce at the coordinates 0, 3, 6, 9 and 12, among which four are less than or equal to 9.



Sample input:
3 6
3 4 5


Sample output:
2

Submission status: Wrong Answer

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

cnt = 1
position = 0

while position < x:
    for i in range(n):
        position += l[i]
        if position <= x:
            cnt += 1
        else:
            break
print(cnt)

Submission status: Wrong Answer

Solution code:
N,X=map(int,input().split())
List = list(map(int, input().split()))
height = 0
res = 1
def checkF(k,x):
  if k>=x:
    return True
  else:
    return False
    
for i in range(N):
  if checkF(height,X):
    break
  height += List[i]
  res +=1
print(res)

Submission status: Wrong Answer

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

D = [0]

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

print(len(D))

Submission status: Wrong Answer

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

for i in range(N):
    p += l[i]
    count += 1
    if p > X:
        break
print(count)

Submission status: Wrong Answer

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

for i in range(N):
    p += l[i]
    count += 1
    if p > X:
        print(count)
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

p=0
cnt=0
for i in L:
 if (X<p):break
 cnt+=1;p+=i
print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

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

curCoord = 0
n = 1

while (curCoord<=X):
    if (n>N):
        break
    else:
        n=n+1
        curCoord = curCoord+L[n-2]
    
print(str(n-1))

Submission status: Wrong Answer

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

d = 0
c = 0
while d <= X:
    c += 1
    d += L[c-1]
    if c >= N:
        break
print(c)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

d = [0] * (N+1)
for i in range(1, N+1):
    if d[i-1] > X:
        break
    d[i] = d[i-1] + l[i]
    cnt = i
print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    n, x = map(int, input().split())
    l = list(map(int, input().split()))
    ans = 0
    cumsum = [0] * (len(l) + 1)
    for i in range(len(l)):
        cumsum[i+1] = cumsum[i] + l[i]
    for i in cumsum:
        if i <= x:
            ans += 1
        else:
            print(ans)
            return
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    n, x = map(int, input().split())
    l = list(map(int, input().split()))
    ans = 0
    cumsum = 0
    for i in l:
        cumsum += i
        ans += 1
        if cumsum > x:
            print(ans)
            return
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

print(b)

Submission status: Wrong Answer

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

while d<=X:
    ans+=1
    d+=L[i]
    i+=1
    if i==N:
        break


print(ans)

Submission status: Wrong Answer

Solution code:
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N, X = mapint()
Ls = list(mapint())

now = 0
cnt = 0
for l in Ls:
    if now>X:
        break
    now += l
    cnt += 1
else:
    cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N, X = mapint()
Ls = list(mapint())

now = 0
cnt = 0
for l in Ls:
    if now>X:
        break
    now += l
    cnt += 1
print(cnt)

Submission status: Wrong Answer

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

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

print(cnt)

Submission status: Wrong Answer

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

cnt = 0
now = 1
for i in range(N):
    l = now + lst[i]
    if now > X:
        break
    cnt += 1
    now = l

print(cnt)

Submission status: Wrong Answer

Solution code:
import sys
def IL(): return map(int,sys.stdin.readline().rstrip().split())

def Main():
    n,x = IL()
    l = list(IL())
    ans = 0
    cur = 0
    for i,item in enumerate(l):
        ans += 1
        cur += item
        if x < cur or n<=i: break
    print(ans)
    return

if __name__=='__main__':
    Main()

Submission status: Wrong Answer

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

cnt = 0
now = 0
for i in range(N):
    l = now + lst[i]
    cnt += 1
    now = l
    if now > X:
        break
print(cnt)

Submission status: Wrong Answer

Solution code:
import math
import collections
import fractions
import itertools

def solve():
    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:
            break
    print(i+1)
    return 0

if __name__ == "__main__":
    solve()

Submission status: Wrong Answer

Solution code:
import sys
def IL(): return map(int,sys.stdin.readline().rstrip().split())

def Main():
    n,x = IL()
    l = list(IL())
    ans = 0
    cur = 0
    for rep in l:
        ans += 1
        cur += rep
        if x < cur: break
    print(ans)
    return

if __name__=='__main__':
    Main()

Submission status: Wrong Answer

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

cnt = 0
now = 0
for i in range(N):
    l = now + lst[i]
    cnt += 1
    if now > X:
        break
print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
def IL(): return map(int,sys.stdin.readline().rstrip().split())

def Main():
    n,x = IL()
    l = list(IL())
    ans = 0
    cur = 0
    for rep in l:
        if x < cur: break
        ans += 1
        cur += rep
    print(ans)
    return

if __name__=='__main__':
    Main()

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()
    d += l[i]
print(n)

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

Submission status: Wrong Answer

Solution code:
n,x = map(int,input().split())
l = list(map(int,input().split()))
a = 0
l.append(0)
if n % 2 != 0:
  for i in range (0,len(l)-1):
    if l[i]+l[i+1]<= x:
      a +=1
  print(a+1)
else :
  for i in range (0,len(l)-1):
    if l[i]+l[i+1]<= x:
      a +=1
  print(a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(count)

Submission status: Wrong Answer

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

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

print(count)

Submission status: Wrong Answer

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

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

print(count)

Submission status: Wrong Answer

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

cnt = 0
now = 0
while now <= x and l:
    cnt += 1
    now += l.pop(0)
print(cnt)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
n, x, *l = map(int, open(0).read().split())
a = 0
while n > a and x >= 0:
    x -= l[a]
    a += 1
print(a)

Submission status: Wrong Answer

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

D = 0
num = 1

while D <= N:
  D = D + L[num-1]
  if D >= X:
    print(num)
    break
  num += 1
else:
  print(N)

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 L:
    D += i
    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

for i in L:
  D += i
  count += 1
  if D > X:
    print(count)
    exit(0)

Submission status: Wrong Answer

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

d = [0] * (n+1)
ans = 0
for n in range(1, n+1):
    d[n] = d[n-1] + l[n-1]
    if d[n] <= x:
        ans += 1

print(ans)

Submission status: Wrong Answer

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

m = 0
ans = 0
for l in L:
    m += l
    ans += 1
    if m >= X:
        print(ans)
        exit()

print(ans)

Submission status: Wrong Answer

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

m = 0
ans = 0
for l in L:
    m += l
    ans += 1
    if m > X:
        print(ans)
        exit()

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in length:
    if D<=X:
        ans+=1
        D = D + i
print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:

url = "https://atcoder.jp//contests/abc130/tasks/abc130_b"

def main():
    n,x = list(map(int, input().split()))
    lis = list(map(int, input().split()))
    lis.insert(0, 0)
    count = 0
    pos = 0
    for l in lis:
        pos += l
        count += 1
        if pos > x:
            print(count)
            exit()
    print(count)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:

url = "https://atcoder.jp//contests/abc130/tasks/abc130_b"

def main():
    n,x = list(map(int, input().split()))
    lis = list(map(int, input().split()))
    count = 0
    pos = 0
    for l in lis:
        if pos > x:
            print(count) if count > 0 else print(1)
            exit()
        pos += l
        count += 1
    print(count+1)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:

url = "https://atcoder.jp//contests/abc130/tasks/abc130_b"

def main():
    n,x = list(map(int, input().split()))
    lis = list(map(int, input().split()))
    count = 0
    pos = 0
    for l in lis:
        if pos > x:
            print(count) if count > 0 else print(1)
            exit()
        pos += l
        count += 1
    print(count)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:

url = "https://atcoder.jp//contests/abc130/tasks/abc130_b"

def main():
    n,x = list(map(int, input().split()))
    lis = list(map(int, input().split()))
    count = 0
    pos = 0
    for l in lis:
        if pos > x:
            print(count) if count > 0 else print(1)
            exit()
        pos += l
        count += 1

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:

url = "https://atcoder.jp//contests/abc130/tasks/abc130_b"

def main():
    n,x = list(map(int, input().split()))
    lis = list(map(int, input().split()))
    count = 0
    pos = 0
    for l in lis:
        if pos > x:
            print(count)
            exit()
        pos += l
        count += 1

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:

url = "https://atcoder.jp//contests/abc130/tasks/abc130_b"

def main():
    n,x = list(map(int, input().split()))
    lis = list(map(int, input().split()))
    count = 0
    pos = 0
    for l in lis:
        if pos >= x:
            print(count)
            exit()
        pos += l
        count += 1

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys

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

ans = 0
for i, l in enumerate(L):
    ans += l
    if ans > X:
        print(i+1)
        break
else:
    print(N-1)

Submission status: Wrong Answer

Solution code:
import sys

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

ans = 0
for i, l in enumerate(L):
    ans += l
    if ans > X:
        print(i+1)
        break
else:
    print(N)

Submission status: Wrong Answer

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

arr=list(map(int,input().split()))
a=0
ans=0

for i in range(N):
    if a<=X:
        ans+=1
        a=a+arr[i]

print(ans)

Submission status: Wrong Answer

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

arr=list(map(int,input().split()))
a=0
ans=0

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

print(ans)

Submission status: Wrong Answer

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

arr=list(map(int,input().split()))
a=0
ans=0

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

Submission status: Wrong Answer

Solution code:
def cumsum(xs):
    result = [0,xs[0]]
    for x in xs[1:]:
        result.append(result[-1] + x)
    return result
a,b=map(int,input().split())
c=list(map(int,input().split()))
n=cumsum(c)
for i in range(len(n)):
    if n[i]>b:
        print(i)
        break

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import numpy as np


def main():
    n, x = map(int, input().split())
    L = np.fromstring(input(), 'int', sep=' ')
    D = np.zeros_like(L)

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

    print(np.count_nonzero(D <= x))


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

curr_bounce = 0
cnt = 0
for i in range(N):
    if i == 0:
        cnt += 1
        continue

    curr_bounce += L[i]
    if curr_bounce > X:
        break
    else:
        cnt += 1
print(cnt)

Submission status: Wrong Answer

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

l = []
cnt = 0
l.append(int(0))
for i in range(N):
  l.append(l[i]+L[i])
  if l[i] <= X:
    cnt += 1
if l[-1] <= X:
  cnt += 1
print(l)
print(cnt)

Submission status: Wrong Answer

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

l = []
cnt = 0
l.append(int(0))
for i in range(N):
  l.append(l[i]+L[i])
  if 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()))
list=[0]
cnt=0
for i in l:
  i=i+list[cnt]
  list.append(i)
  cnt+=1

ans=0
for i in list:
  if i>=x:
    ans+=1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

arr2 = input().split()

d = 0
count = 1
for i in range(1, n + 1):
  d += int(arr2[i-1])
  if d <= x:
    count +=1
  print(d)
    
print(count)

Submission status: Wrong Answer

Solution code:
N, val= list(map(int,input().split()))
list = list(map(int,input().split()))
d=0
l=[]
for i in list:
  ans=d+i
  l.append(ans)
count=0
for num in l:
  if num<=val:
    count=count+1
print(count)

Submission status: Wrong Answer

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

D = 0
count = 0
for L in L_list:
    if D > X:
        break
    count += 1
    D += L
print(count)

Submission status: Wrong Answer

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

# D = 0
# count = 0
# for L in L_list:
#     if D <= X:
#         count += 1
#     else:
#         break
#     D += L
# print(count)




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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
y = [int(z) for z in input().split()]
l = [int(z) for z in input().split()]
d = [0]*(y[0]+1)
c = 0
for i in range(1,y[0]+1):
      d[i] = d[i-1]+l[i-1]
      if (d[i]<=y[1]):
            c+=1
print(c)

Submission status: Wrong Answer

Solution code:
y = [int(z) for z in input().split()]
l = [int(z) for z in input().split()]
d = [0]*(y[0]+1)
for i in range(1,y[0]+1):
      d[i] = d[i-1]+l[i-1]
      if (d[i]>y[1]):
            if (i==y[0]):
                  i+=1
            break
print(i)

Submission status: Wrong Answer

Solution code:
y = [int(z) for z in input().split()]
l = [int(z) for z in input().split()]
d = [0]*(y[0]+1)
for i in range(1,y[0]+1):
      d[i] = d[i-1]+l[i-1]
      if (d[i]>y[1]):
            break
print(i)

Submission status: Wrong Answer

Solution code:
y = [int(z) for z in input().split()]
l = [int(z) for z in input().split()]
d = 0
i=0
while (d<=y[1]) and i<y[0]+1:
      d = d+l[i-1]
      i+=1
if (i>y[0]+1):
      print(y[0]+1)
else:
      print(i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import bisect

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

d = []
for i in range(n):
    if i == 0: d.append(0)
    else:
        di = d[i-1] + l[i-1]
        d.append(di)

res = bisect.bisect_right(sorted(d), x)
#print(len([i for i in d if i <= x]))
print(res)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

H = 0
count = 0
for i in range(n):
  if H > x:
    print(count)
    exit()
  else:
    H += L[i]
    count += 1
  
print(n+1)

Submission status: Wrong Answer

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

H = 0
count = 0
for i in range(n):
  if H > x:
    print(count)
    exit()
  else:
    H += L[i]
    count += 1
  
print(n)

Submission status: Wrong Answer

Solution code:
N,X = (int(x) for x in input().split())
L = [int(x) for x in input().split()]
s = 0
i = 0
while (s <= X):
  if i >= N:
    print(N)
    quit()
  else:
    s = s + L[i]
    i = i + 1
print(i)

Submission status: Wrong Answer

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

d =0
count=1
for i in range(N):
    d = d+L[i]
    if d > X:
        print(count)
        break
    count+=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):
    D += L[i]
    if D >= X:
        print(i + 1)
        break

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import sys
N, X = map(int, input().split())
l = list(map(int, input().split()))
l.insert(0, 0)
val, count = 0, 0
for i in l:
    val += i
    if val <= X:
        count += 1
    else:
        print(count)
        sys.exit()

Submission status: Wrong Answer

Solution code:
import sys
N, X = map(int, input().split())
l = list(map(int, input().split()))
val, count = 0, 1
for i in l:
    val += i
    if val <= X:
        count += 1
    else:
        print(count)
        sys.exit()
    if len(l) == 1:
        print(count)
        sys.exit()

Submission status: Wrong Answer

Solution code:
import sys
N, X = map(int, input().split())
l = list(map(int, input().split()))
val, count = 0, 1
for i in l:
    val += i
    if val <= X:
        count += 1
    else:
        print(count)
        sys.exit()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import numpy as np

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

CS_L = np.cumsum(L).tolist()
ans = len([l for l in CS_L if l <= x])
print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np

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

CS_L = np.cumsum(L).tolist()
ans = len([l for l in L if l <= x])
print(ans)

Submission status: Wrong Answer

Solution code:
from collections import deque

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

d, i = 0, 0
deq = deque(L)
while d <= x and len(deq) > 0:
    d += deq.popleft()
    i += 1

print(i)

Submission status: Wrong Answer

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

d, i = 0, 0
while d <= x and i < n:
    d += L[i]
    i += 1

print(i)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def main():
    n,x = map(int,input().split())
    l = list(map(int, input().split()))
    dist = 0
    count = 0
    for i in range(n):
        dist += l[i]
        if dist > x:
            break
        count += 1
    print(count)
    
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
def main():
    n,x = map(int,input().split())
    l = list(map(int, input().split()))
    dist = 0
    count = 0
    for i in range(n):
        if dist > x:
            break
        dist += l[i]
        count += 1
    print(count)
    
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
def main():
    N, X = map(int, input().split())
    A = list(map(int, input().split()))
    cnt = 0
    D = 0
    for a in A:
        if D > X:
            print(cnt)
            break
        D += a
        cnt += 1

    else:
        print(cnt)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N,X=map(int,input().split())
if N!=1:
  L=list(map(int,input().split()))
  tot=0
  count=0
  while X>=tot:
    tot+=L[count]
    count+=1
    if count==N:
      break
  print(count)
else:
  L=int(input())
  if X>=L:
    print(2)
  else:
    print(1)