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()))
L = [0] + l
D = [0]
count = 0
for i in range(1,N+2):
    D.append(D[i-1]+L[i-1])
    if D[i]<= X:
        count += 1

print(count + 1)

Submission status: Wrong Answer

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

print(count + 1)

Submission status: Wrong Answer

Solution code:
#ABC130 B

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

print(count + 1)

Submission status: Wrong Answer

Solution code:
#ABC130 B

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

print(count + 1)

Submission status: Wrong Answer

Solution code:
#ABC130 B

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 0
bound = 0
for i in l:
    bound += i
    ans += 1
    if bound > x:
        break

print(ans)

Submission status: Wrong Answer

Solution code:
N,X = map(int,input().split())
L = list(map(int,input().split()))
List = [0]*(N+1)
for i in range(1,N+1):
    List[i] = List[i-1] + L[i-1]
print(List)
import bisect  
# A = [i for i in List if i <=X]
# print(len(A))
print(bisect.bisect_left(List,X+1))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

d = 1
count = 1

for y in range(n):
  d = d + l[y]
  if d <= 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()))
cnt = 1
bx = 0
for l in L:
  cnt += 1
  bx += l
  if bx == x:
    print(cnt)
    break
  elif bx > x:
    print(cnt - 1)
    break

Submission status: Wrong Answer

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

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 = (int(i) for i in input().split())
list_l = [int(j) for j in input().split()]
tmp = 0
count = 0
for i in range(0, n + 1):
    count += 1
    if i == 0: continue
    else:
        tmp += list_l[i - 1]
        if tmp > x:
            break
print(count - 1)

Submission status: Wrong Answer

Solution code:
n, x = (int(i) for i in input().split())
list_l = [int(j) for j in input().split()]
tmp = 0
count = 0
for i in range(0, n + 1):
    if i == 0: continue
    else:
        tmp += list_l[i - 1]
        count += 1
        if tmp > x:
            break
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
n, x = M()
l = LI()
wa = 0
ans = 0
for i in l:
    if wa <= x:
        ans += 1
        wa += i
    else:
        break
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

x=0
n=0
for L in ls1:
    n=n+1
    x=x+L
    if x>=X:
        print(n)
        break
    if n>=N:
        print(n)
        break

Submission status: Wrong Answer

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

x=0
n=0
for L in ls1:
    x=x+L
    n=n+1
    if x>X:
        print(n)
        break
    if n>=N:
        print(n)
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import itertools
import bisect

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

dl = [0] + list(itertools.accumulate(ll))

print(bisect.bisect_right(ll, x))

Submission status: Wrong Answer

Solution code:
import itertools

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

dl = [0] + list(itertools.accumulate(ll))

for i in range(len(dl)):
    if dl[i] > x:
        print(i)
        break

Submission status: Wrong Answer

Solution code:
r=input().split()
N=int(r[0])
X=int(r[1])
d=[int(s) for s in input().split()]
ans=1
le=0
for i in range(N):
    le+=d[i]
    if le>X:
        print(ans)
        break
    else:
        ans+=1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def mapt(fn, *args):
    return tuple(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))


def main():
    n, x = Input()
    l = Input()
    d = list(range(n+1))
    ans = 0

    for i in range(1, n+1):
        d[i] = d[i-1] + l[i-1]

    for i in d:
        if i <= x: ans += 1

    print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for l in L:
    val += l
    if val <= x:
        count += 1
print(count)

Submission status: Wrong Answer

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

for i, l in enumerate(L):
    val += l
    if val > x:
        print(i+1)
        break

if val == sum(L):
    print(len(L))

Submission status: Wrong Answer

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

for i, l in enumerate(L):
    val += l
    if val > x:
        print(i+1)
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

    print(cnt)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
n, x = map(int, input().split())
L = list(map(int, input().split()))
dist = 0
res = 0
for i, l in enumerate(L, 1):
    dist += l
    if dist > x:
        print(i)
        exit()
    elif dist == x:
        print(i + 1)
        exit()
print(n)

Submission status: Wrong Answer

Solution code:
n, x = map(int, input().split())
L = list(map(int, input().split()))
dist = 0
res = 0
for i, l in enumerate(L, 1):
    dist += l
    if dist > x:
        print(i)
        exit()
    elif dist == x:
        print(min(i + 1, n))
        exit()

Submission status: Wrong Answer

Solution code:
n, x = map(int, input().split())
L = list(map(int, input().split()))
dist = 0
res = 0
for i, l in enumerate(L, 1):
    dist += l
    if dist > x:
        print(i)
        exit()
    elif dist == x:
        print(min(i + 1, n))
        exit()
print(n)

Submission status: Wrong Answer

Solution code:
n, x = map(int, input().split())
L = list(map(int, input().split()))
dist = 0
res = 0
for i, l in enumerate(L, 1):
    dist += l
    if dist > x:
        print(i)
        exit()
    elif dist == x:
        print(i + 1)
        exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


INF = float('inf')


n, x = LI()
l = LI()
cnt = 1
d = 0
for i in range(n):
    print(f'{(d, l[i])=}')
    if d + l[i] <= x:
        cnt += 1
        d += l[i]
    else:
        break
print(cnt)

Submission status: Wrong Answer

Solution code:
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


INF = float('inf')


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

Submission status: Wrong Answer

Solution code:
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


INF = float('inf')


n, x = LI()
l = LI()
cnt = 0
d = 0
for i in range(n):
    if d <= x:
        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()))
L = [0] + l

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

Submission status: Wrong Answer

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

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

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

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 i + l[i] <= 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
for i in range(N) :
    D = L[i]+D
#    print(i,D)
    if D>X :
        print(i+1)
        exit()

print(N)

Submission status: Wrong Answer

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

jump = 0
cnt = 0
for i in list:
    if cnt < n and jump <= x:
        cnt += 1
        jump += i
    else:
        break

print(cnt)

Submission status: Wrong Answer

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

jump = 0
cnt = 0
for i in list:
    if cnt <= n and jump <= x:
        cnt += 1
        jump += i
    else:
        break

print(cnt)

Submission status: Wrong Answer

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

jump = 0
cnt = 0
for i in list:
    if jump <=x:
        cnt += 1
        jump += i
    else:
        break

print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding = SJIS
n, x = map(int, input().split())
lis = list(map(int, input().split()))
ans = 1
now = 0

for i in range(n):
    if now + lis[i] <= x:
        ans += 1
        now += lis[i]
if ans > n:
    ans -= 1

print(ans)

Submission status: Wrong Answer

Solution code:
# coding = SJIS
n, x = map(int, input().split())
lis = list(map(int, input().split()))
ans = 1
now = 0

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

Submission status: Wrong Answer

Solution code:
n, x = map(int, input().split())
l = list(map(int, input().split()))
Sum = 0
ans = 0
i = 0
while Sum <= x:
    Sum += l[i]
    i += 1
    ans += 1
    if i >= len(l):
        break

print(ans)

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

Submission status: Wrong Answer

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

D = 0
ans = 0

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

print(ans)

Submission status: Wrong Answer

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

D = 0
ans = 0

for i in range(N):
    D += Ls[i]
    if X < D:
        break

print(i+1)

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

print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,X=map(int,input().split())
L=list(map(int,input().split()))
Y=[0]
D=0
while D<=X:
    for i in range(0,N):
        D=D+L[i]
        Y.append(D)
if Y[len(Y)-2]==X:
    print(len(Y)-1)
else:
    print(len(Y)-2)

Submission status: Wrong Answer

Solution code:
N,X=map(int,input().split())
L=list(map(int,input().split()))
Y=[0]
D=0
while D<=X:
    for i in range(0,N):
        D=D+L[i]
        Y.append(D)
print(Y)
if Y[len(Y)-2]==X:
    print(len(Y)-1)
else:
    print(len(Y)-2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,X = map(int,input().split())
L = list(map(int,input().split()))
d = 0
i = 0
while True:
    d += L[i]
    if d > X or i == N-1:
        break
    i += 1
print(i+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8

def solve(X, Ls):
  c, s = 0, 0
  for L in Ls:
    if s > X:
      break
    s += L
    c += 1
  return c


if __name__ == '__main__':
  _, X = map(int, input().split())
  print(solve(X, map(int, input().split())))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
n, x = M()
l = LI()
l.insert(0, 0)
d = 0
ans = 0
for i in l:
    if d <= x:
        ans += 1
        d += i
    else:
        break
print(ans-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, X = map(int, input().split(' '))
L_ls = map(int, input().split(' '))
D, cnt = 0, 0
for L in L_ls:
    cnt += 1
    D += L
    if D > X:
        break
print(cnt)

Submission status: Wrong Answer

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

i = 0
s = 0
while(s <= X and i <= len(L)):
  i += 1
  if i < len(L):
    s += L[i]

print(i)

Submission status: Wrong Answer

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

i = 1
s = 0
while(s <= X and i < len(L)):
  s += L[i]
  i += 1

print(i)

Submission status: Wrong Answer

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

i = 0
s = 0
while(s <= X and i < len(L)):
  s += L[i]
  i += 1

print(i)

Submission status: Wrong Answer

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

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-1):
    if sum>X:
        print(i)
        exit()
    sum += l[i]
print(N+1)

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-1):
    if sum>X:
        print(i)
        exit()
    sum += l[i]

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):
    if sum>X:
        print(i)
        exit()
    sum += l[i]

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n, x = map(int, input().split())
data = [0] + list(map(int, input().split()))
count = 0
tmp = 0
for d in data:
    tmp += d
    if tmp < x:
        count += 1
    # print(tmp)

print(count)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

d=0

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

if d<x:
    count +=1

print(count)