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: Runtime Error

Solution code:
list_1 = [int(x) for x in il_1.split(' ')] # N と　X
list_2 = [int(x) for x in il_2.split(' ')]
 
sum_list = []
for i in list_2:
    if sum(sum_list) < list_1[1]:
      sum_list.append(i)
    elif sum(sum_list) == list_1[1]:
      print(len(sum_list) + 1)
      break
    elif sum(sum_list) > list_1[1]:
      print(len(sum_list))
      break
if sum_list < list_1[1]
    print(list_1[0] + 1)

Submission status: Runtime Error

Solution code:
import sys

def input():
    return sys.stdin.readline().rstrip()

if __name__ == "__main__":
    n, x = map(int, input().split())
    l = list(map(int, input().split()))
    l.insert(0, 0)

    num = 0
    sum = 0
    while sum + l[num] <= x:
        sum += l[num]
        num += 1

    print(num)

Submission status: Runtime Error

Solution code:
from sys import stdin
from collections import defaultdict

N, X = [int(x) for x in stdin.readline().rstrip().split()]
L = []
L = [int(x) for x in stdin.readline().rstrip().split()]

D = 0
i = 0
while(D<=X and i<N+1):
    i += 1
    D += L[i-1]

print(i)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

print(i)

Submission status: Runtime Error

Solution code:
il_1 = input()
il_2 = input()

list_1 = [int(x) for x in il_1.split(' ')] # N と　X
list_2 = [int(x) for x in il_2.split(' ')]

sum_list = []
for i in list_2:
    if sum(sum_list) < list_1[0]:
      sum_list.append(i)
    elif sum(sum_list) == list_1[0]
      sum_list.append(i)
      print(len(sum_list) + 1)
      break
    elif sum(sum_list) > list_1[0]
      print(len(sum_list))
      break

Submission status: Runtime Error

Solution code:
il_1 = input()
il_2 = input()

list_1 = [int(x) for x in il_1.split(' ')] # N と　X
list_2 = [int(x) for x in il_2.split(' ')]

sum_list = []
for i in list_2:
    if sum(sum_list) < list_1[1]
      sum_list.append(i)
    else:
      print(len(sum_list))

Submission status: Runtime Error

Solution code:
il_1 = input()
il_2 = input()

list_1 = [int(x) for x in il_1.split(' ')] # N と　X
list_2 = [int(x) for x in il_2.split(' ')]

sum_list = []
for i in list_2:
    if sum(sum_list) < list_1[0]
      sum_list.append(i)
    else:
      print(len(sum_list))

Submission status: Runtime Error

Solution code:
x1 = list(map(int,input().rstrip().split(" ")))
x2 = list(map(int,input().rstrip().split(" ")))

def makey(x1,x2):
  total = 0
  for i in range(x1[0]):
    total += x2[i]
    if total > x1[1]:
      return i
y = makey(x1,x2)
print(y+1)

Submission status: Runtime Error

Solution code:
import re
import numpy as np

N, X = [int(i) for i in re.split(" ", input())]
Ls = [int(i) for i in re.split(" ", input())]
Ds = np.cumsum(Ls)
counts = np.sum(Ls <= X) + 1
print(counts)

Submission status: Runtime Error

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

# print(n, x, l_list)
d = 0
i = 0
while d <= x:
    d += l_list[i]
    i += 1

print(i)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;

int N,X;
cin >> N >> X;
int L[N];
for(int i=0;i<N;i++){
  cin>>L[i];
}

int D=0;
int ans=1;
for(int i=0;i<N;i++){
  D += L[i];
  if(D <= X){
    ans++;
  }
  else break;
}
cout << ans << endl;

Submission status: Runtime Error

Solution code:
using namespace std;

int N,X;
cin >> N >> X;
int L[N];
for(int i=0;i<N;i++){
  cin>>L[i];
}

int D=0;
int ans=1;
for(int i=0;i<N;i++){
  D += L[i];
  if(D <= X){
    ans++;
  }
  else break;
}
cout << ans << endl;

Submission status: Runtime Error

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

print(ans)

Submission status: Runtime Error

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

count = 0
sum = 0

for i in range(len(l)):
  sum += l[i]
  if sum <= x
    count+=1
print(count + 1)

Submission status: Runtime Error

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

count = 0
sum = 0

for i in range(len(l)):
  sum += l[i]
  if sum < x
    count+=1
print(count)

Submission status: Runtime Error

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

count = 0
sum = 0

while sum <= x and count <= n:
  sum += l[count]
  count+=1
print(count)

Submission status: Runtime Error

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

count = 0
sum = 0

while sum <= x and count <= n + 1:
  sum += l[count]
  count+=1
print(count)

Submission status: Runtime Error

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

count = 0
sum = 0

while sum <= x or count == n + 1:
  sum += l[count]
  count+=1
print(count)

Submission status: Runtime Error

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

count = 0
sum = 0

while sum <= x or count == len(l) + 1:
  sum += l[count]
  count+=1
print(count)

Submission status: Runtime Error

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

count = 0
sum = 0

while sum <= x:
  sum += l[count]
  count+=1
print(count)

Submission status: Runtime Error

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

count = 0
sum = 0

while sum <= x:
  sum += l[count]
  count+=1
print(count + 1)

Submission status: Runtime Error

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

count = 0
sum = 0

while sum <= x:
  sum += l[count]
  count+=1
print(count + 1)

Submission status: Runtime Error

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

count = 0
sum = 0

while sum <= x:
  sum += l[count]
  count+=1
print(count + 1)

Submission status: Runtime Error

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

count = 0
sum = 0

while sum <= x:
  sum += l[count]
  count++
print(count + 1)

Submission status: Runtime Error

Solution code:
nx = map(int, raw_input().split())
l = map(int, raw_input().split())
 
n = nx[0]
x = nx[1]
 
d = L[0]
i = 1
L = 1
 
while d <= x:
    d += l[L]
    i += 1
    L += 1  
    if i == n + 1:
      break
print(i)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

d = 0
count = 0
while d <= x:
    d += ls[count]
    count += 1

print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N,X=map(int,input().split())
for i in range(0,N):
  L=int(input())
D=0
for i in range(0,N):
  D=D+L
  if D<=X:
    continue
  else:
    print(i)

Submission status: Runtime Error

Solution code:
nx = map(int, raw_input().split())
l = map(int, raw_input().split())
 
n = nx[0]
x = nx[1]
 
d = 0
i = 0
 
while d <= x:
    if i  == n + 1:
      break
    d += l[i]
    i += 1 
print(i)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N, X = map(lambda x: int(x), input().split())[:2]
L = map(lambda x: int(x), input().split())
D = 0
count = 0
for l in L:
  if D <= X:
      count += 1
  D += l
print(count)

Submission status: Runtime Error

Solution code:
N, X = map(lambda x: int(x), input().split())[:2]
L = map(lambda x: int(x), input().split())
D = 0
count = 0
for l in L:
  if D <= X:
      count += 1
  D += int(l)
print(count)

Submission status: Runtime Error

Solution code:
N, X = map(lambda x: int(x), input().split())[:2]
L = map(lambda x: int(x), input().split())
D = 0
count = 0
for i, l in enumerate(L):
if D <= X:
    count += 1
D += int(l)
print(count)

Submission status: Runtime Error

Solution code:
N, X = map(lambda x: int(x), input().split())
L = map(lambda x: int(x), input().split())
D = 0
count = 0
for i, l in enumerate(L):
if D <= X:
    count += 1
D += int(l)
print(count)

Submission status: Runtime Error

Solution code:
import sys

if __name__ == '__main__':
  N, X = map(input().split(), lambda x: int(x))
  L = map(input().split(), lambda x: int(x))
  D = 0
  count = 0
  for i, l in enumerate(L):
    if D <= X:
      count += 1
    D += l
  print(count)

Submission status: Runtime Error

Solution code:
import sys

if __name__ == '__main__':
  N = 0
  X = 0
  L = []
  for i, line in enumerate(sys.stdin):
    if i == 2:
      break
    line = line.split()
    if i == 0:
      N = line[0]
      X = line[1]
    if i == 1:
      L = line
  D = 0
  count = 0
  for l in L:
    if D < X:
      count += 1
    D += int(l)
  print(count)

Submission status: Runtime Error

Solution code:
import math
import fractions
import copy
import numpy as np
def j(q):
    if q==1: print("POSSIBLE")
    elif q == 0:print("IMPOSSIBLE")
    exit(0)
rem = pow(10,9)+7
"""
def ct(x,y):
    if (x>y):print("+")
    elif (x<y): print("-")
    else: print("?")
"""

def ip():
    return int(input())
def iprow():
    return [int(i) for i in input().split()]
def printrow(a):
    for i in a:
        print(i)
def combinations(n,r):
    if n<r:return 0
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
def permutations(n,r):
    if n<r:return 0
    return math.factorial(n) // math.factorial(n - r)
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

#n = ip()                                     #入力整数1つ
x,y= (int(i) for i in input().split())       #入力整数横2つ以上
#a = [int(i) for i in input().split()]        #入力整数配列
#a = input()                                  #入力文字列
#a = input().split()                          #入力文字配列
#n = ip()                      #入力セット(整数改行あり)(1/2)
#a=[ip() for i in range(m)]    #入力セット(整数改行あり)(2/2)
#a=[input() for i in range(n)]    #入力セット(整数改行あり)(2/2)
#jの変数はしようできないので注意
#a.pop(0)は10^5あるときTLEしやすい!注意!抜くなら逆ソート!

a = iprow()

dp = [0]
for i in range(1,x+1):
    dp.append(dp[i-1]+a[i-1])
s = 0
while dp[s] <= y:s+=1
print(s)

Submission status: Runtime Error

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

i = 0
D = 0
while True:
    if D > X:
        print(i)
        break
    D = D + L[i]
    i = i + 1

Submission status: Runtime Error

Solution code:
#coding:utf-8

import sys

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

D = 0 #ジャンプする座標

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

print(N+1)

Submission status: Runtime Error

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

count = 1
d = 0
for i in range(N):
        d_a = d + int(l_list[i])
        d = d_a
        if d_a <= X:
                count +=1
        else:
                print(count)
            　　break

Submission status: Runtime Error

Solution code:
[n,x]=[int(_) for _ in input().split()]
li=[int(_) for _ in input().split()]
d=li[0]
a=1
while True:
  d+=li[a]
  a+=1
  if d>x: break
  if a>len(li): 
    a=len(li)
    break
print(a)

Submission status: Runtime Error

Solution code:
[n,x]=[int(_) for _ in input().split()]
li=[int(_) for _ in input().split()]
d=li[0]
a=1
while True:
  d+=li[a]
  if d>x or a==len(li): break
  a+=1
print(a)

Submission status: Runtime Error

Solution code:
[n,x]=[int(_) for _ in input().split()]
li=[int(_) for _ in input().split()]
d=li[0]
a=1
while True:
  #d<=x and a<len(li):
  d+=li[a]
  a+=1
  if d>x: break
#  if a==len(li): break
print(a)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
c = 0
b = 0
for an in range(n):
    c+=1
    b+=ls[an]
    if b>x:
        break
print(c)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

if n == 1:
    print(1)
else:
    l = list(map(int,input().split(" ")))

    count = 0
    d = 0
    while True:
        d += l[count]
        if d > x:
            break
        else:
            count += 1

    print(count+1)

Submission status: Runtime Error

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

count = 0
d = 0
while True:
    d += l[count]
    if d > x:
        break
    else:
        count += 1

print(count+1)

Submission status: Runtime Error

Solution code:
N,X = map(int,input().split())
Li = list(map(int,input().split()))	
for i in range(N):
  SUM += Li[i]
  if SUM > X:
    print(i+1)
    SUM -= 1000

Submission status: Runtime Error

Solution code:
N,X = map(int,input().split())
Li = list(map(int,input().split()))	
for i in range(N):
  SUM += Li[i]
  if SUM > X
  	print(i+1)
    SUM -= 1000

Submission status: Runtime Error

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

while count<n && sum+l[count]<=x:
    sum=sum+l[count]
    count=count+1

print(count+1)

Submission status: Runtime Error

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

while sum+l[count]<=x:
    sum=sum+l[count]
    count=count+1

print(count+1)

Submission status: Runtime Error

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

while sum+l[count-1]<=x:
    sum=sum+l[count-1]
    count=count+1
    
print(count)

Submission status: Runtime Error

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

while sum+l[count-1]<=x:
    sum=sum+l[count-1]
    count=count+1
    print(sum)
    print(count)


print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# coding: utf-8
# Your code here!
# 行数を取得
import sys
list=[]
for line in sys.stdin:
    list.append(line)

NandX=list[0].split()
N=int(NandX[0])
X=int(NandX[1])

L=list[1].split()
D=0
i=0
while D<=X:
    D=D+int(L[i])
    i+=1
print(i)

Submission status: Runtime Error

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

print(i)

Submission status: Runtime Error

Solution code:
a,b=input().split()
d=0
n=1
l=input().split( )
while True:
  d+=int(l[n])
  if d<=int(b):
    n+=1
  else:
    break
print(n)

Submission status: Runtime Error

Solution code:
a,b=input().split()
d=0
n=0
l=input().split( )
while True:
  if d>int(b):
    break
  if d==int(b):
    n+=1
    break
  else:
    w=l[n]
    d+=int(w)
    n+=1

print(n)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

bound = 0
ans = 1

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

ans,i,D=0,1,0

while D<=X:
    D+=L[i-1]
    ans+=1
    i+=1
    
print(ans)

Submission status: Runtime Error

Solution code:
N, X = map(int, input().split())
steps = list(int,input().split())
 
x = 0
count = 1

for i in steps:
    x += i
    if x <= X:
        count += 1
 
print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

x = 0
count = 0

while x < X:
    x += int(steps[int(count)])
    count +=1

print(count)

Submission status: Runtime Error

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

x = 0
count = 0

while x <= X:
    x += int(steps[int(count)])
    count +=1

print(count)

Submission status: Runtime Error

Solution code:
import logging

logging.basicConfig(level=logging.INFO, format="%(message)s")
logging.disable(logging.CRITICAL)

N, X  = (int(x) for x in input().split())
L = list(int(x) for x in input().split())

logging.info(L)

length = 0
counter = 1

for i in L:
    length += i
    if length <= X:
        counter++
    
print(counter)

Submission status: Runtime Error

Solution code:
    import logging
     
    logging.basicConfig(level=logging.INFO, format="%(message)s")
    logging.disable(logging.CRITICAL)
     
    N, X  = (int(x) for x in input().split())
    L = list(int(x) for x in input().split())
     
    logging.info(L)
     
    length = 0
    counter = 1
     
    if X < L[0]:
        print(1)
    else:
        for i in L:
            length += i
            if length >= X or counter == N:
                break
            counter += 1
        
        print(counter)

Submission status: Runtime Error

Solution code:
import logging
 
logging.basicConfig(level=logging.INFO, format="%(message)s")
logging.disable(logging.CRITICAL)
 
N, X  = (int(x) for x in input().split())
L = list(int(x) for x in input().split())
 
logging.info(L)
 
length = 0
counter = 1
if X < L[0]:
    print(1)
else:
    for i in L:
        length += i
        if length > X or counter == N:
            break
        counter += 1
       
    print(counter

Submission status: Runtime Error

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

count = 0
index = 0
while index <= X:
  count += 1
  index += lst[count-1]

print(count)

Submission status: Runtime Error

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

count = 1
index = 0
while index <= X:
  index += lst[count-1]
  if index <= X:
    count += 1

print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# coding: utf-8
# submission # - User: herp_sy
# https://atcoder.jp/contests/

import math
import statistics

n,x = map(int, input().split())
d = []
l = list(map(int, input().split()))
cnt = 0

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

print(cnt)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b=map(int, inout().split())
list = input().split(' ')

s = 0
c = !

for item in list:
    c += 1
    if (s + int(item)) <= b:
        s += int(item)
    else:
        break

print(c)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n,x=(int(i) for i in input().split())
d=0
c=0
for i in range(n):
  l=int(input())
  d=d+l
  if d<=x:
    c=c+1
  elif d>x:
    print(c)
    break

Submission status: Runtime Error

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

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

dis = 0
i = 0

while True:
    dis += l[i]
    
    if dis > x:
        break
    i += 1

print(i+1)

Submission status: Runtime Error

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

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

dis = 0
i = 0

while dis <= x:
    dis += l[i]
    i += 1

print(i)

Submission status: Runtime Error

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

print(c)

Submission status: Runtime Error

Solution code:
#B問題
N,X = map(int,input().split())
L = list(map(int,input().split()))
land = [0]
for i in range(N):
    land.append(land[-1]+L[i])
land.sort()
count = 0
for l in land:
    if land <= X:
        count+=1
        
print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n,x=map(int,input().split())
L=list(map(int,input().split()))
d=0
count=1
for i in range(n+1):
    d += L[i]

    if d > x:
        print(count)
        break
    else:
        count += 1

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:

import sys
input = sys.stdin.readline
#-------------------------------------

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

cnt = 1
d = 0

for _ in range(n+1):
    if n is 1:
        d = d+l[0]
        break

    if d+l[cnt-1] <= x:
        d = d+l[cnt-1]
        cnt += 1
        # print(d)
    else:
        break

print(cnt)

Submission status: Runtime Error

Solution code:

import sys
input = sys.stdin.readline
#-------------------------------------

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

cnt = 1
d = 0

for _ in range(n+1):
    if d+l[cnt-1] <= x:
        d = d+l[cnt-1]
        cnt += 1
        # print(d)
    else:
        break

print(cnt)

Submission status: Runtime Error

Solution code:
# -*- Coding: utf-8 -*-
N, X = map(int, input().split())
L = list(map(int,input().split()))

ans = 1
p = 0
p += L[ans]
while p <= X:
    p += L[ans]
    ans += 1

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n,x=input().split()
N=int(n)
X=int(x)
L=[]
L=input().split()
l=[int(s) for s in L]
i=0
if len(l)==N:
    while(X>=0):
        X-=l[i]
        i=i+1
    print(i)
else:
    print("エらー")

Submission status: Runtime Error

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

ans = 1
sum = 0

for i in range(N):
    sum += L[i]
    if sum <= X:
        num += 1
    else:
        break

print(ans)

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;
#define INCANT cin.tie(0), cout.tie(0), ios::sync_with_stdio(false), cout << fixed << setprecision(20);
#define int long long
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define _overload(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for(int i = (int)(a); i < (int)(b); i++)
#define rep(...) _overload(__VA_ARGS__, repi, _rep)(__VA_ARGS__)
#define _rev(i, n) revi(i, n, 0)
#define revi(i, a, b) for(int i = (int)(a - 1); i >= (int)(b); i--)
#define rev(...) _overload(__VA_ARGS__, revi, _rev)(__VA_ARGS__)
#define each(i, n) for(auto&& i: n)
void in(){}
template<typename F, typename... R>
bool in(F& f, R&... r){
    if(cin >> f){in(r...);return true;}
    else return false;
}
#define out(x) cout << (x)
#define space() cout << " "
#define indent() cout << '\n'
void print(){}
template<typename F, typename... R>
void print(F f, R... r){out(f), indent(), print(r...);}
#define debughead(x) cerr << "Line " << __LINE__ << ": " << #x << ": "
#define debugout(x) cerr << (x) << " "
#define debugindent() cerr << '\n'
#define debug(x) debughead(x), debugout(x), debugindent()
const int INF = 1e18, MOD = 1e9 + 7;
template<typename T>
bool chmax(T& a, T b){return (a = max(a, b)) == b;}
template<typename T>
bool chmin(T& a, T b){return (a = min(a, b)) == b;}

main(){
    INCANT;
    int n, x, l, res = 0;
    string s;
    in(n, x);
    rep(i, 1, n + 1){
        in(l);
        res += l;
        if(res > x){
            print(i);
            return 0;
        }
    }
    print(n + 1);
}

Submission status: Runtime Error

Solution code:
variable = input().split(" ")
n = int(variable[0])
x = int(variable[1])
l = input().split(" ")
d = 0
i = 0

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

Submission status: Runtime Error

Solution code:
variable = input().split(" ")
n = int(variable[0])
x = int(variable[1])
l = input().split(" ")
d = 0
i = 0

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

Submission status: Runtime Error

Solution code:
n,x=map(int, input().split())
llist=list(map(int, input().split()))
point=0
cnt=0
while point<=x:
  point+=llist[cnt]
  cnt+=1
  if cnt>n:
    break
print(cnt)

Submission status: Runtime Error

Solution code:
n,x=map(int, input().split())
llist=list(map(int, input().split()))
point=0
cnt=0
while point<=x:
  cnt+=1
  point+=llist[cnt]
  if cnt>n:
    break
print(cnt)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
l = input().split()
n = int(l[0])
x = int(l[1])
l = input().split()
cnt = 1
d = 0

while(True):
    d = d + int(l[cnt-1])
    if(d<=x):
        cnt = cnt + 1
    else:
        break

print(cnt)

Submission status: Runtime Error

Solution code:
# -*- Coding: utf-8 -*-
N, X = map(int, input().split())
L = list(map(int,input().split()))

index = 0
Sum = 0
while Sum <= X:
    Sum += L[index]
    index += 1

print(index)

Submission status: Runtime Error

Solution code:
# -*- Coding: utf-8 -*-
N, X = map(int, input().split())
L = list(map(int,input().split()))

index = 0
Sum = 0
while Sum <= X:
    Sum += L[index]
    index += 1

print(index+1)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

sum = 0
count = 0
while sum <= x:
    sum += L[count]
    count += 1
    if count == n+1:
        break


print(count)

Submission status: Runtime Error

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