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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

D = 0
ans = 0
i = 0

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

print(ans)

Submission status: Runtime Error

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

D = 0
ans = 0
i = 0

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

print(ans)

Submission status: Runtime Error

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

coordinate = 0
count = 1

while True:
    coordinate += L[count-1]
    if coordinate > X:
        break
    else:
        count += 1

print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

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

j = 0
sum = 0
while x >= sum:
    sum += l[j]
    j += 1
    
print(j)

Submission status: Runtime Error

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

i = 0
sum = 0
while x >= sum:
    sum += 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
count=1
for i in range(n):
  d += n[i]
  if d<=x:
    count+=1
print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:

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

curCoord = 0
n = 1

while (curCoord<=X and n<=(N+1)):
    n = n+1
    curCoord = curCoord+L[n-2]
    
print(n-1)

Submission status: Runtime Error

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

curCoord = 0
n = 1

while (curCoord<=X):
    n=n+1
    curCoord = curCoord+L[n-2]
    
print(str(n-1))

Submission status: Runtime Error

Solution code:

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

curCoord = 0
n = 1

while (curCoord<=X):
    n=n+1
    curCoord = curCoord+L[n-2]
    
print(n-1)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

dist = np.zeros(N+1, dtype=int)
for i in range(N):
  dist[i+1] = dist[i] + L[i]

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

Submission status: Runtime Error

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

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:
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

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

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

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

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

ans = [0]
tmp = 0
i = 0

if n == 1:
  print(1)
else:
  while tmp <= x:
    tmp = tmp + l[i]
    ans.append(tmp)
    i += 1
  print(-1+len(ans))

Submission status: Runtime Error

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

ans = [0]
tmp = 0
i = 0

if n == 1:
  print(i)
else:
  while tmp <= x:
    tmp = tmp + l[i]
    ans.append(tmp)
    i += 1
  print(-1+len(ans))

Submission status: Runtime Error

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

ans = [0]
tmp = 0
i = 0

while tmp <= x:
  tmp = tmp + l[i]
  ans.append(tmp)
  i += 1
print(-1+len(ans))

Submission status: Runtime Error

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

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

while D < X+1:
  count += 1
  D += L[i]
  i += 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
i = 0

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

Submission status: Runtime Error

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

while D < X+1:
  D += L[i-1]
  i += 1
  count += 1

print(count)

Submission status: Runtime Error

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

while D < X+1:
  D += L[i-1]
  i += 1
  count += 1

print(count)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

D = 0
num = 1

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
N,X=map(int,input().split())
length=list(map(int,input().split()))
ans=0
D=0
i=0
while True:
    if D<=X:
        ans+=1
    else:
        break
    D=D+length[i]
    i+=1
print(ans)

Submission status: Runtime Error

Solution code:
n, x= map(int, input().split())
d = 0
count = 0
for i in range (n):
  l1, l2, i  = map(int, input().split()
while (d <= x):
  d = d + l 
  count += 1
print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

print(ans)

Submission status: Runtime Error

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

ans = 1
t = 0
for i in range(x):
  t += l[i]
  if t <= x:
    ans += 1
  else:
    break
print(ans)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

d, i = 0, 0
while d < x:
    d += 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, i = 0, 0
while d <= x:
    d += L[i]
    i += 1

print(i)

Submission status: Runtime Error

Solution code:
d, i = 0, 0
while d <= x:
    d += 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]*(n+1)
ans = 1

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

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

for i in range(N + 1):
    M = M + L[i]
    if M >= X:
        print(C)
        exit(0)
    
    C = C + 1

print(C)

Submission status: Runtime Error

Solution code:
from sys import stdin, setrecursionlimit


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

    ans = 1
    d = 0
    while True:
        d += l.pop(0)
        if d <= x:
            ans += 1
        else:
            break
    print(ans)


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

Submission status: Runtime Error

Solution code:
n,x=map(int,input().split())
L=list(map(int,input().split()))
D=[0]*(N+1)
o=True
for i in range(n):
    D[i+1]=D[i]+L[i]
for i in range(len(D)):
    if D[i]>x:
        print(i)
        o=False
        break
if o:
    print(n+1)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N , X = (int(a) for a in input().split())
L = list(map(int,input().split()))
length = 0
bound = 0
i = 0
while length <= X :
    length += L[i]
    bound += 1
    i += 1

print(bound)

Submission status: Runtime Error

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

xnow = 0
ans = 0
while xnow <= x:
    ans+=1
    xnow += l[ans-1]
print(ans)

Submission status: Runtime Error

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

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

d = 0
i = 0

while d <= x:
    d = d + l[i]
    i += 1
    if i > n: break
    
ans = min(i,n)
print(ans)

Submission status: Runtime Error

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

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

print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n, x = [int(x) for x in input().split()]
k = 0
ans = 1
for li in input().split():
    k += li
    ans += k <= x

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef vector<ll> vl;
typedef vector<string> vs;
typedef vector<char> vc;
typedef queue<ll> ql;
typedef deque<ll> dql;
typedef priority_queue<ll, vl/*, greater<ll>*/> pql; //降順(/*昇順*/)
typedef set<ll> sl;
typedef pair<ll, ll> pl;
typedef vector<vl> vvl;
typedef vector<pl> vpl;
#define rep(i, n) for(ll i = 0; i < ll(n); i++)
#define rep2(i, n) for(ll i = 1; i <= ll(n); i++)
//#define rep(i, k, n) for(ll i = k-1; i < ll(n); i++)
//#define rep2(i, k, n) for(ll i = k; i <= ll(n); i++)
#define all(v) (v).begin(), (v).end()
bool chmin(ll &a, ll b) {if(b < a) {a = b; return 1;} return 0;}
bool chmax(ll &a, ll b) {if(b > a) {a = b; return 1;} return 0;}
const ll INF = 1LL << 60;
const ll MOD = 1e9 + 7;
//const ll MOD = 998244353;
const ll MAX = 1e9;
const char newl = '\n';

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);

  ll n, x;
  cin >> n >> x;
  vl l(n);
  rep(i, n) cin >> l[i];
  
  ll sum = 0;
  rep(i, n) {
    sum += l[i];
    if(l[i] > x) {
      cout << i+1 << newl;
      return 0;
    }
  }
  
  cout << n+1 << newl;
  return 0;
}

Submission status: Runtime Error

Solution code:
import os

def main():
    n,x = map(int, input().split())
    list_a = list(map(int, input().split()))
    ans = 0
    count = 1
    i = 0

    while(ans <= x):
        ans += list_a[i]
        if ans <= x:
            count += 1
            i += 1
        else:
            break

    print(count)

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
import os

def main():
    n,x = map(int, input().split())
    list_a = list(map(int, input().split()))
    ans = 0
    count = 1
    i = 0

    while(ans < x):
        ans += list_a[i]
        if ans <= x:
            count += 1
            i += 1
        else:
            break

    print(count)

if __name__ == "__main__":
    main()

Submission status: Runtime Error

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

print(cnt)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

dis = 0
ans = 1
for i in range(n+1):
    dis += L[i]
    if dis > x:
        dis -= L[i]
        break
    ans += 1

print(ans)

Submission status: Runtime Error

Solution code:
import itertools
N,X = list(map(int,input().split()))
L = list(map(int,input().split()))
L = list(itertools.accumulate(L))
cnt = 0
for l in L:
    if X < L:
        print(cnt)
        exit()
    cnt += 1
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 L:
    D+=L
    if D<=X:
        count+=1
    else:
        break
print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# ABC130B

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:
        return i+1
return n+1

Submission status: Runtime Error

Solution code:
# B - Bounding

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

print(cnt)

Submission status: Runtime Error

Solution code:
n,x=map(int,input().split())
l=list(map(int,input().split()))
length=0
i=0
while length<=x:
    length+=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
count = 0
i = 1
while d <= x:
    d = d + l[i - 1]
    count += 1
    if i <= n - 1
        i += 1

print(count)

Submission status: Runtime Error

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

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

print(count)

Submission status: Runtime Error

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

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

print(count)

Submission status: Runtime Error

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

print(cnt)

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+=L[i]
  i+=1
print(i)

Submission status: Runtime Error

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

Sum=0
Count=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=[int(s) for s in input().split(" ")]

Sum=0
Count=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()))
D = 0
c = 0

while D <= x:
	D += L[c]
	c += 1
print(c)

Submission status: Runtime Error

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

count=0
dist=0

i=0
while dist<=X and count<=N:
    dist+=L[count]
    count+=1
    #print(dist)

print(count)

Submission status: Runtime Error

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

count=0
dist=0

i=0
while dist<=X or i<N-1:
    count+=1
    dist+=L[i]
    i+=1
    #print(dist)

print(count)

Submission status: Runtime Error

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

count=0
dist=0

i=0
while dist<=X or i<N:
    count+=1
    dist+=L[i]
    i+=1
    #print(dist)

print(count)

Submission status: Runtime Error

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

count=0
dist=0

i=0
while dist<=X:
    count+=1
    dist+=L[i]
    i+=1
    #print(dist)

print(count)

Submission status: Runtime Error

Solution code:
n,x = map(int,input().split())
l = list(map(int,input().split()))
m = 0
a = 0
while(a<=x):
    a+=l.pop(0)
    m+=1
print(m)

Submission status: Runtime Error

Solution code:
import sys
from math import ceil, floor, sqrt, sin, cos, pi
from itertools import accumulate, permutations, combinations
from fractions import gcd # 最大公約数
from collections import deque, Counter
from operator import itemgetter
from heapq import heappop,heappush
sys.setrecursionlimit(10**7)
def lcm(x, y): return ((x * y) // gcd(x, y)) # 最小公倍数
# list(map(int, input().split()))
# map(int, input().split())
# int(input())
# input().split()
# mojiretu = ','.join(str_list)
# sorted(input())

n, x = map(int, input().split())
a = list(map(int, input().split()))
ans = 0
now = 0
while True:
    if now > x:
        print(ans)
        sys.exit()
    now += a[ans]
    ans += 1

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

print(count)

Submission status: Runtime Error

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

x = 0
for i in range(N + 1):
    if i == 0:
        x = 0
    else:
        x += L[i - 1]
        if x > X:
            ans = i
            break

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
i = input().split()

n,x = list(map(int, i))

l = input().split()

l = list(map(int, l))

step = [0]

c = 0

aux = 0

while step[-1] < x:
    c += 1
    step.append(step[c - 1] + l[c - 1])

for i in step:
    if i <= x:
        aux += 1


print(aux)

Submission status: Runtime Error

Solution code:
i = input().split()

n,x = list(map(int, i))

l = input().split()

l = list(map(int, l))

step = [0]

c = 0

while step[-1] < x:
    c += 1
    step.append(step[c - 1] + l[c - 1])

print(len(step) - 1)

Submission status: Runtime Error

Solution code:
def function(N, L, X):
    D = [0]
    for i in range(1, N+2):
        D.append(D[i-1]+L[i-1])
        if D[-1] > X:
            return i

line = input()
N, X = [int(n) for n in line.split()]
line = input()
L = [int(n) for n in line.split()]
print(function(N, L, X))

Submission status: Runtime Error

Solution code:
line1 = input()
line2 = input()
D = 0
res = 0
for i in range(int(line1[0])):
    if D <= int(line1[2]):
        res += 1
    else:
        break
    D = D + int(line2[2*i])
if D <= int(line1[2]):
    res += 1
print(res)

Submission status: Runtime Error

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

sum = 0
ans = 0

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

print(ans+1)

Submission status: Runtime Error

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

sum = 0
ans = 0

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

Submission status: Runtime Error

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

sum = 0
ans = 0

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

Submission status: Runtime Error

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

sum = 0
ans = 0

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

Submission status: Runtime Error

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

sum = 0
ans = 0

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

Submission status: Runtime Error

Solution code:
n,x= input().split()
b_list= list(map(int, input().split()))
temp = 0
counter = 0
for i in range(n):
    if (temp<=int(x)):
        counter +=1
    temp += b_list[i]

print(counter)

Submission status: Runtime Error

Solution code:
n,x= int(input().split())
b_list= list(map(int, input().split()))
temp = 0
counter = 0
for i in b_list:
    if (temp<=x):
        counter +=1
    temp += i

print(counter)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N,X=map(int, input().split())
L=list(map(int, input().split()))
count = 0
x=0
while x <= X and count <= N:
  x = x + L[count]
  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
x=0
while x <= X and count <= N+1:
  x = x + L[count]
  count = count + 1
print(count)

Submission status: Runtime Error

Solution code:
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

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

D = 0
cnt = 0
while D <= X:
    D += A[cnt]
    cnt += 1

print(cnt)

Submission status: Runtime Error

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

def main():
    N, X = list(map(int,readline().split()))
    L = map(int,readline().split())
    sum = 0
    cnt = 1
    for n in N:
        sum += n
        if sum <= X:
            cnt += 1
    print(cnt)

    return

if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

c = 1
d = 0
for x in L:
    d = d + x
    if d <= X :
        ans += 1

print(ans)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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