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.insert(0, 0)
d = 0
cnt = 0

for i in range(n+1):

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

Submission status: Wrong Answer

Solution code:
n,x=map(int,input().split())
l=list(map(int,input().split()))
a=0
for i in range(n):
  a+=l[i]
  if a>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]
s = 0
for i in L:
    A.append(A[-1] + i)
for i in range(len(A)):
    if A[i] > x:
        print(i)
        break

Submission status: Wrong Answer

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

L = list(map(int, input().split()))
A = [0]
s = 0
for i in L:
    A.append(A[-1] + i)
for i in range(len(A)):
    if A[i] <= x:
        continue
    else:
        print(i)
        break

Submission status: Wrong Answer

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

cnt = 0
pos = 0
for i in range(n+1):
    if i == 0:
        cnt += 1
    
    if pos + Ls[i-1] <= x:
        cnt += 1
       
    pos += Ls[i-1]

print(cnt)

Submission status: Wrong Answer

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

cnt = 0
pos = 0
for i in range(n+1):
    if i == 0:
        cnt += 1
    
    if pos + Ls[i-1] <= x:
        cnt += 1
        pos += Ls[i-1]
    

print(cnt)

Submission status: Wrong Answer

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

for i in range(1,N):
    D.append(D[i-1]+L[i-1])

ans=0

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

Submission status: Wrong Answer

Solution code:
a=list(map(int,input().split()))
N=a[0]
X=a[1]
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[-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()))

if sum(l)<=x:
  print(n+1)
  exit()

i=1
d=0
while d<=x:
    d+=l[i-1]
    i+=1
print(i)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

i=0
d=0
while d<=x and i<n:
    d+=l[i]
    i+=1
print(i)

Submission status: Wrong Answer

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

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

print(i)

Submission status: Wrong Answer

Solution code:
N, *L,  = [list(map(int, s.split())) for s in open(0)]
L = L[0]
idx = 0
cnt = 0
for l in L:
    if idx <= N[1]:
        cnt += 1
    idx += l
print(cnt)

Submission status: Wrong Answer

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

a = 0
b = [0]
for i in range(0, N):
  a = a + int(List[i])
  b.append(a)

for i, c in enumerate(b, 1):
  if c > X :
    print(i-1)
    exit()

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
n,x=map(int,input().split())
A=list(map(int,input().split()))

for i in range(n):
    if x-A[i]<0:
        print(i+1)
        exit()
    else:
        x-=A[i]

print(n)

Submission status: Wrong Answer

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

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

if x > sum(l):
    ans += 1

print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 0
cnt = 0

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

Submission status: Wrong Answer

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

ans = 0
cnt = 0

for i in range(n):
  if cnt <= x:
    ans += 1
  cnt += l[i]
if cnt >= x:
  print(ans)
else:
  print('1')

Submission status: Wrong Answer

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

ans = 0
cnt = 0
if x < l[0]:
  print('1')
  exit()
for i in range(n):
  if cnt > x:
    print(ans)
    exit()
  
  cnt += l[i]
  ans += 1
  if cnt > x:
    print(ans)
    exit()
  elif cnt == x:
    print(ans + 1)
    exit()
  
  #print(cnt)
  #print(ans)
print(n)

Submission status: Wrong Answer

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

ans = 0
cnt = 0
if x < l[0]:
  print('1')
  exit()
for i in range(n):
  
  
  cnt += l[i]
  ans += 1
  if cnt > x:
    print(ans)
    exit()
  elif cnt == x:
    print(ans + 1)
    exit()
  
  #print(cnt)
  #print(ans)
print(n)

Submission status: Wrong Answer

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

ans = 0
cnt = 0
if x > l[0]:
  print('1')
  exit()
for i in range(n):
  
  
  cnt += l[i]
  ans += 1
  if cnt > x:
    print(ans)
    exit()
  elif cnt == x:
    print(ans + 1)
    exit()
  
  #print(cnt)
  #print(ans)
print(n)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

ans = 0
cnt = 0
for i in range(n):
  cnt += l[i]
  ans += 1 

  if cnt > x:
    print(ans)
    exit

Submission status: Wrong Answer

Solution code:
A,D = map(int,input().split())
X = list(map(int,input().split()))
C = [0]
q = 0
for i in range(A):
  if i == 0:
    p = X[0]
    C.append(p)
  else:
    p = p + X[i]
    C.append(p)
for i in C:
  if D <= i:
    q += 1
print(q)

Submission status: Wrong Answer

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

x = 0
ans = 0
for a in A:
    if x > X:
        break
    x += a
    ans += 1
print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline

ri = lambda: int(input())
rs = lambda: input().rstrip()
ril = lambda: list(map(int, input().split()))
rsl = lambda: input().rstrip().split()
ris = lambda n: [ri() for _ in range(n)]
rss = lambda n: [rs() for _ in range(n)]
rils = lambda n: [ril() for _ in range(n)]
rsls = lambda n: [rsl() for _ in range(n)]

n, x = ril()
ls = ril()
s = 0
for i, l in enumerate(ls, 1):
    s += l
    if s > x:
        print(min(n + 1, i))
        exit()

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline

ri = lambda: int(input())
rs = lambda: input().rstrip()
ril = lambda: list(map(int, input().split()))
rsl = lambda: input().rstrip().split()
ris = lambda n: [ri() for _ in range(n)]
rss = lambda n: [rs() for _ in range(n)]
rils = lambda n: [ril() for _ in range(n)]
rsls = lambda n: [rsl() for _ in range(n)]

n, x = ril()
ls = ril()
s = 0
for i, l in enumerate(ls, 1):
    s += l
    if s > x:
        print(min(n, i))
        exit()

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline

ri = lambda: int(input())
rs = lambda: input().rstrip()
ril = lambda: list(map(int, input().split()))
rsl = lambda: input().rstrip().split()
ris = lambda n: [ri() for _ in range(n)]
rss = lambda n: [rs() for _ in range(n)]
rils = lambda n: [ril() for _ in range(n)]
rsls = lambda n: [rsl() for _ in range(n)]

n, x = ril()
ls = ril()
s = 0
for i, l in enumerate(ls, 1):
    s += l
    if s > x:
        print(i)
        exit()

Submission status: Wrong Answer

Solution code:
from collections import defaultdict, deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys
import random
import itertools
import math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt


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


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


def LI_(): return list(map(lambda x: int(x)-1, input().split()))


def II(): return int(input())


def IF(): return float(input())


def LS(): return list(map(list, input().split()))


def S(): return list(input().rstrip())


def IR(n): return [II() for _ in range(n)]


def LIR(n): return [LI() for _ in range(n)]


def FR(n): return [IF() for _ in range(n)]


def LFR(n): return [LI() for _ in range(n)]


def LIR_(n): return [LI_() for _ in range(n)]


def SR(n): return [S() for _ in range(n)]


def LSR(n): return [LS() for _ in range(n)]


def gcd(x, y):
    if y == 0:
        return x
    return gcd(y, x % y)


def my_index_multi(l, x):
    return [i for i, _x in enumerate(l) if _x == x]


def sosu(x):
    for i in range(2, int(sqrt(x)+1)):
        if x % i == 0:
            return False
    return True


mod = 1000000007
inf = float('INF')


def A():
    X, A= LI()
    
    if(X >= A):
        print(10)
    elif(X<A):
        print(0)
    return

# B


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


    
    return

# C


def true():
    S = input()
    S = S[:-1]

    tmp = 0
    for x in range(1 << (len(S)-1)):
        func = S[-1]
        for i in range(len(S)-1):
            if(x & (1 << i)):
                tmp += int(func)
                func = S[-2-i]
            else:
                func = S[-2-i]+func
        tmp += int(func)
    print(tmp)

    return


def flagcounter(x):
    if (x == 0):
        return 0
    return flagcounter(x >> 1)+(x & 1)


def C():
    W, H, x,y=LI()
    
    if (W/2==x and H/2==y):
        print(W*H/2,1)
    else:
        print(W*H/2,0)

    return


# D


def D():

    a, b, x = LI()
    BIG = a*a*b/2
    if x > BIG:
        y = 2*b-(2*x/a/a)
        print(math.degrees(math.atan(y/a)))
    else:
        y = 2*x/a/b
        print(math.degrees(math.atan(b/y)))
    return

# E


def E():
    N, K = LI()
    A = LI()
    F = LI()
    A.sort(reverse=True)
    F.sort()
    cost = []
    for i in range(len(N)):
        cost.append(A[i]*F[i])

    a = F[cost.index(max(cost))]

    return

# F


def F():
    N, M = LI()

    value = [0] * M
    power = [0] * M
    for i in range(M):
        a, b = LI()
        value[i] = a
        c = LI()
        L = ['0'] * N
        for k in c:
            L[k - 1] = '1'
        bint = ''.join(L)
        power[i] = int(bint, 2)
    bint = ''.join(list(['1'] * N))
    dp = [inf] * (int(bint, 2)+1)
    t = 0
    cost = 0

    dp[0] = 0
    for s in range(int(bint, 2) + 1):
        for i in range(M):
            t = s | power[i]
            cost = dp[s] + value[i]
            dp[t] = min(dp[t], cost)
    print(-1) if(dp[-1] == inf) else print(dp[-1])

    return

    # you can write to stdout for debugging purposes, e.g.
# print("this is a debug message")


def solution(S):
    # write your code in Python 3.6
    N = len(S)

    pass


# Solve
if __name__ == '__main__':

    B()

Submission status: Wrong Answer

Solution code:
from collections import defaultdict, deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys
import random
import itertools
import math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt


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


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


def LI_(): return list(map(lambda x: int(x)-1, input().split()))


def II(): return int(input())


def IF(): return float(input())


def LS(): return list(map(list, input().split()))


def S(): return list(input().rstrip())


def IR(n): return [II() for _ in range(n)]


def LIR(n): return [LI() for _ in range(n)]


def FR(n): return [IF() for _ in range(n)]


def LFR(n): return [LI() for _ in range(n)]


def LIR_(n): return [LI_() for _ in range(n)]


def SR(n): return [S() for _ in range(n)]


def LSR(n): return [LS() for _ in range(n)]


def gcd(x, y):
    if y == 0:
        return x
    return gcd(y, x % y)


def my_index_multi(l, x):
    return [i for i, _x in enumerate(l) if _x == x]


def sosu(x):
    for i in range(2, int(sqrt(x)+1)):
        if x % i == 0:
            return False
    return True


mod = 1000000007
inf = float('INF')


def A():
    X, A= LI()
    
    if(X >= A):
        print(10)
    elif(X<A):
        print(0)
    return

# B


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


    
    return

# C


def true():
    S = input()
    S = S[:-1]

    tmp = 0
    for x in range(1 << (len(S)-1)):
        func = S[-1]
        for i in range(len(S)-1):
            if(x & (1 << i)):
                tmp += int(func)
                func = S[-2-i]
            else:
                func = S[-2-i]+func
        tmp += int(func)
    print(tmp)

    return


def flagcounter(x):
    if (x == 0):
        return 0
    return flagcounter(x >> 1)+(x & 1)


def C():
    W, H, x,y=LI()
    
    if (W/2==x and H/2==y):
        print(W*H/2,1)
    else:
        print(W*H/2,0)

    return


# D


def D():

    a, b, x = LI()
    BIG = a*a*b/2
    if x > BIG:
        y = 2*b-(2*x/a/a)
        print(math.degrees(math.atan(y/a)))
    else:
        y = 2*x/a/b
        print(math.degrees(math.atan(b/y)))
    return

# E


def E():
    N, K = LI()
    A = LI()
    F = LI()
    A.sort(reverse=True)
    F.sort()
    cost = []
    for i in range(len(N)):
        cost.append(A[i]*F[i])

    a = F[cost.index(max(cost))]

    return

# F


def F():
    N, M = LI()

    value = [0] * M
    power = [0] * M
    for i in range(M):
        a, b = LI()
        value[i] = a
        c = LI()
        L = ['0'] * N
        for k in c:
            L[k - 1] = '1'
        bint = ''.join(L)
        power[i] = int(bint, 2)
    bint = ''.join(list(['1'] * N))
    dp = [inf] * (int(bint, 2)+1)
    t = 0
    cost = 0

    dp[0] = 0
    for s in range(int(bint, 2) + 1):
        for i in range(M):
            t = s | power[i]
            cost = dp[s] + value[i]
            dp[t] = min(dp[t], cost)
    print(-1) if(dp[-1] == inf) else print(dp[-1])

    return

    # you can write to stdout for debugging purposes, e.g.
# print("this is a debug message")


def solution(S):
    # write your code in Python 3.6
    N = len(S)

    pass


# Solve
if __name__ == '__main__':

    B()

Submission status: Wrong Answer

Solution code:
from collections import defaultdict, deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys
import random
import itertools
import math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt


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


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


def LI_(): return list(map(lambda x: int(x)-1, input().split()))


def II(): return int(input())


def IF(): return float(input())


def LS(): return list(map(list, input().split()))


def S(): return list(input().rstrip())


def IR(n): return [II() for _ in range(n)]


def LIR(n): return [LI() for _ in range(n)]


def FR(n): return [IF() for _ in range(n)]


def LFR(n): return [LI() for _ in range(n)]


def LIR_(n): return [LI_() for _ in range(n)]


def SR(n): return [S() for _ in range(n)]


def LSR(n): return [LS() for _ in range(n)]


def gcd(x, y):
    if y == 0:
        return x
    return gcd(y, x % y)


def my_index_multi(l, x):
    return [i for i, _x in enumerate(l) if _x == x]


def sosu(x):
    for i in range(2, int(sqrt(x)+1)):
        if x % i == 0:
            return False
    return True


mod = 1000000007
inf = float('INF')


def A():
    X, A= LI()
    
    if(X >= A):
        print(10)
    elif(X<A):
        print(0)
    return

# B


def B():
    N, X= LI()
    L=LI()
    
    ans=1
    D=0
    for i in range(1,N):
        D=D+L[i]
        if (D>X):
            break
        ans+=1
    print(ans)
    


    
    return

# C


def true():
    S = input()
    S = S[:-1]

    tmp = 0
    for x in range(1 << (len(S)-1)):
        func = S[-1]
        for i in range(len(S)-1):
            if(x & (1 << i)):
                tmp += int(func)
                func = S[-2-i]
            else:
                func = S[-2-i]+func
        tmp += int(func)
    print(tmp)

    return


def flagcounter(x):
    if (x == 0):
        return 0
    return flagcounter(x >> 1)+(x & 1)


def C():
    N = II()

    L = []
    A=[]

    for i in range(N):
        A.append(II())
        LL=[]

        for j in range(A[i]):
            x, y = LI()
            LL.append((x-1, y))
        L.append(LL)
    # print(L)
    #print(L[0][0])
    ans=0
    for x in range(1 << N):
        ok=True
        for i in range(N):
            if(x & (1 << i)):
                for j,k in L[i]:
                    if (((x >> j) & 1) ^ k):
                        ok=False 
        if ok :
            ans=max(ans, flagcounter(x))

    print(ans)


# D


def D():

    a, b, x = LI()
    BIG = a*a*b/2
    if x > BIG:
        y = 2*b-(2*x/a/a)
        print(math.degrees(math.atan(y/a)))
    else:
        y = 2*x/a/b
        print(math.degrees(math.atan(b/y)))
    return

# E


def E():
    N, K = LI()
    A = LI()
    F = LI()
    A.sort(reverse=True)
    F.sort()
    cost = []
    for i in range(len(N)):
        cost.append(A[i]*F[i])

    a = F[cost.index(max(cost))]

    return

# F


def F():
    N, M = LI()

    value = [0] * M
    power = [0] * M
    for i in range(M):
        a, b = LI()
        value[i] = a
        c = LI()
        L = ['0'] * N
        for k in c:
            L[k - 1] = '1'
        bint = ''.join(L)
        power[i] = int(bint, 2)
    bint = ''.join(list(['1'] * N))
    dp = [inf] * (int(bint, 2)+1)
    t = 0
    cost = 0

    dp[0] = 0
    for s in range(int(bint, 2) + 1):
        for i in range(M):
            t = s | power[i]
            cost = dp[s] + value[i]
            dp[t] = min(dp[t], cost)
    print(-1) if(dp[-1] == inf) else print(dp[-1])

    return

    # you can write to stdout for debugging purposes, e.g.
# print("this is a debug message")


def solution(S):
    # write your code in Python 3.6
    N = len(S)

    pass


# Solve
if __name__ == '__main__':

    B()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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 L:
    if D > x:
        print(c)
        exit()
    D = D + i
    c = c + 1
if D <= x:
  print(c)
else:
  print(c-1)

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 L:
    if D > x:
        print(c)
        exit()
    D = D + i
    c = c + 1
if D > x:
  print(c)
else:
  print(c-1)

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 L:
    if D > x:
        print(c)
        exit()
    D = D + i
    c = c + 1
print(c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

from itertools import accumulate

Lcum = accumulate(L)

count = 1
for l in Lcum:
    if l > X:
        print(count)
        exit()
    else:
        count += 1

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

d = 0
i = 0
i_max = len(L)
while d <= X:
    if i >= i_max:
        break
    d += L[i]
    i += 1
print(i)

Submission status: Wrong Answer

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

d = [0]
cnt = 0
for i in range(1,n):
    if d[i-1] + l[i-1]<= x:
        d.append(d[i-1] + l[i-1])
    else:
        break

print(len(d))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
N,X = [int(i) for i in input().split()]
L = list(map(int, input().split()))

def D(i):
        if i == 0:
                return 0
        return D(i - 1)+ L[i - 1]

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
N,X = [int(i) for i in input().split()]
L = list(map(int, input().split()))

def D(i):
        if i == 0:
                return 0
        return D(i - 1)+ L[i - 1]

Z = 0
for i in range(N):
    if D(i) <= X:
        Z += 1
print(Z)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(i+1)

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

Submission status: Wrong Answer

Solution code:
import sys

N, X = map(int, (input().split()))
L = list(map(int, input().split()))
point = 0
count = 1

for x in range(0, N):
    point+=L[x]
    if(point<=X):
        count+=1
    if(point>=X):
        print(count)
        sys.exit()

Submission status: Wrong Answer

Solution code:
import sys

N, X = map(int, (input().split()))
L = list(map(int, input().split()))
point = 0
count = 1

for x in range(0, N):
    point+=L[x]
    if(point<=X):
        count+=1
    if(point>=X):
        print(count)
        sys.exit

Submission status: Wrong Answer

Solution code:
import sys

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

for x in range(0, N):
    sum+=L[x]
    if(sum>X):
        print(x+1)
        sys.exit()

Submission status: Wrong Answer

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

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

    putted = False
    for i in range(n):
        if p[i] >= x:
            print(i)
            putted = True
            break

    if not putted:
        print(len(p) - 1)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import math

def main():
    n, x = [int(ip) for ip in input().split()]
    l = [int(ip) for ip in input().split()]

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

    p.append(prev)

    print(p)

    putted = False
    for i in range(n):
        print(">", p[i])
        if p[i] >= x:
            print(i)
            putted = True
            break

    if not putted:
        print(len(p) - 1)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

def main():
    n, x = [int(ip) for ip in input().split()]
    l = [int(ip) for ip in input().split()]

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

    putted = False
    for i in range(n):
        if p[i] > x:
            print(i)
            putted = True
            break

    if not putted:
        print(len(p) - 1)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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