problem_id stringclasses 100
values | submission_id stringlengths 10 10 | status stringclasses 2
values | code stringlengths 6 806 |
|---|---|---|---|
p03000 | s740930352 | Accepted | n, x = map(int,input().split())
l = list(map(int,input().split()))
d = [0] * (n + 1)
for i in range(1,n+1):
d[i] = d[i-1] + l[i-1]
ans = sum(d[i] <= x for i in range(n+1))
print(ans)
|
p03000 | s308118001 | Accepted | n,x=map(int,input().split())
l=list(map(int,input().split()))
zahyou=[0]
for i in range(n):
zahyou.append(zahyou[i]+l[i])
for i in range(len(zahyou)):
if zahyou[i]>x:
del zahyou[i:n+1]
break
print(len(zahyou)) |
p03000 | s612736483 | Accepted | n = list(map(int, input().split()))
m = list(map(int, input().split()))
ans = 0
new_list = [0]
for i in range(n[0]):
ans = ans + m[i]
if ans <= n[1]:
new_list.append(ans)
elif ans > n[1]:
break
print(len(new_list))
|
p03000 | s323537186 | Accepted | N, X = map(int,input().split())
L = list(map(int,input().split()))
ans = 1
d = 0
for i in range(N):
d += L[i]
if d <= X:
ans += 1
print(ans) |
p03000 | s881566070 | Accepted | N,X=map(int,input().split())
L=list(map(int,input().split()))
count=1
tmp=0
for i in range(N):
tmp+=L[i]
if tmp<=X:
count+=1
print(count) |
p03000 | s960726287 | Accepted | n,x = map(int,input().split())
l=list(map(int,input().split()))
plot=0
cnt=1
for i in range(n):
plot += l[i]
if plot <= x:
cnt += 1
print(cnt) |
p03000 | s159654178 | Accepted | N, X = map(int, input().split())
L = list(map(int, input().split()))
import numpy as np
arr = [0]
for i in range(1, N+1):
arr.append(arr[i-1]+L[i-1])
arr = np.array(arr)
ans = len(arr[arr<=X])
print(ans) |
p03000 | s655410111 | Accepted | n,x=map(int,input().split())
l=list(map(int,input().split()))
cnt=0
ans=1
for i in range(n):
cnt+=l[i]
if cnt<=x:
ans+=1
else:
break
print(ans)
|
p03000 | s386241730 | Accepted |
n,x = map(int, input().split())
a = list(map(int, input().split()))
cnt = 1
total = 0
for i in range(n):
total += a[i]
if total <= x:
cnt += 1
print(cnt)
|
p03000 | s654374063 | Accepted | N,X=map(int,input().split())
L=list(map(int,input().split()))
l=0
cnt=1
for i in range(N):
l+=L[i]
if l<=X: cnt+=1
else: break
print(cnt) |
p03000 | s640226948 | Accepted | N, X = map(int, input().split())
L = list(map(int, input().split()))
pos = 0
for i, l in enumerate(L, 1):
pos += l
if pos > X:
print(i)
break
else:
print(N + 1)
|
p03000 | s100656470 | Accepted | N, X = map(int, input().split())
Llist = [int(i) for i in input().split()]
Dlist = []
for i in range(N+1):
if i == 0:
Dlist.append(0)
else:
Dlist.append(Dlist[i-1]+Llist[i-1])
print(len([i for i in Dlist if i <= X])) |
p03000 | s720455783 | Accepted | n,x = map(int,input().split())
a = list(map(int,input().split()))
c = 1
b = 0
for i in a:
b = i+b
if b <= x:
c+=1
print(c) |
p03000 | s062129868 | Accepted | N, X = map(int, input().split())
L = list(map(int, input().split()))
D = []
for i in range(N+1):
if i == 0:
D.append(0)
else:
D.append(D[i-1]+L[i-1])
count = [1 for i in D if i <= X]
print(len(count)) |
p03000 | s277869317 | Accepted | 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 l in L:
sum += l
if sum <= X:
cnt += 1
print(c... |
p03000 | s767449395 | Accepted | n,x = map(int,input().split())
l = list(map(int,input().split()))
cur = ans = 0
for i in range(n):
cur += l[i]
if cur<=x:
ans += 1
print(ans+1) |
p03000 | s136013019 | Accepted | k, n = list(map(int, input().split(' ')))
l = list(map(int, input().split(' ')))
ct = 0
ans = 1
i = 0
while ct <= n and i < len(l):
ct += l[i]
ans += (ct <= n)
i += 1
print(ans) |
p03000 | s461103827 | Accepted | N, X = map(int, input().split())
L = list(map(int, input().split()))
ans = 1
now = 0
for i in range(N):
if now + L[i] <= X:
ans += 1
now += L[i]
else:
break
print(ans)
|
p03000 | s077629635 | Accepted | N, X = map(int, input().split())
L = list(map(int, input().split()))
from itertools import groupby, accumulate, product, permutations, combinations
def solve(N,X,L):
L = accumulate(L)
ans = 1
for i,l in enumerate(L):
if l>X:
ans += i
break
else:
ans += N
retu... |
p03000 | s363524070 | Accepted | n,x=list(map(int,input().split()))
l=list(map(int,input().split()))
a=0
for i in range(n):
a+=l[i]
# print('i:',i,'a:',a)
if a>x:break
if x<a:print(i+1)
else:print(i+2) |
p03000 | s761581993 | Accepted | n, x = map(int, input().split())
L = list(map(int, input().split()))
dis = 0
bound = 1
for i in range(n):
dis += L[i]
if dis <= x:
bound += 1
else:
break
print(bound) |
p03000 | s964634788 | Accepted | line1 = [int(n) for n in input().split()]
line2 = [int(n) for n in input().split()]
D = 0
res = 0
for i in range(line1[0]):
if D <= int(line1[1]):
res += 1
else:
break
D = D + int(line2[i])
if D <= int(line1[1]):
res += 1
print(res) |
p03000 | s261695607 | Accepted | import sys
input = lambda: sys.stdin.readline().rstrip()
input_nums = lambda: list(map(int, input().split()))
def main():
N, X = input_nums()
L = input_nums()
s = 0
cnt = 1
for i in range(N):
s += L[i]
if s <= X: cnt += 1
print(cnt)
if __name__ == '__main__':
main() |
p03000 | s389568158 | Accepted | N,X = map(int,input().split())
L = list(map(int,input().split()))
Z = 0
cnt = 1
for i in range(N):
Z += L[i]
if Z <= X:
cnt += 1
else:
break
print(cnt) |
p03000 | s852869267 | Accepted | N, X = map(int, input().split())
l = list(map(int, input().split()))
l.insert(0, 0)
val, count = 0, 0
for i in l:
val += i
if val <= X:
count += 1
else:
break
print(count)
|
p03000 | s680652331 | Accepted | n, x = map(int, input().split())
list = list(map(int, input().split()))
count, now = 1, 0
for i in range(n):
now += list[i]
if now > x:
break
count += 1
print(count)
|
p03000 | s901848942 | Accepted | n, x = map(int, input().split())
l = list(map(int, input().split()))
count, sum = 1, 0
for i in range(n):
sum += l[i]
if sum <= x:
count += 1
else:
break
print(count) |
p03000 | s367319866 | Accepted | N, X = map(int, input().split())
L = list(map(int, input().split()))
D = 0
num = 1
for i in range(len(L)):
D = D + L[i]
if D <= X:
num += 1
else:
break
print(num) |
p03000 | s493857920 | Accepted | a,b = list(map(int,input().split()))
d = list(map(int,input().split()))
c = 0
count = 1
for i in range(a):
c += d[i]
if c <= b:
count += 1
print(count) |
p03000 | s681975868 | Accepted | N, X = map(int, input().split())
L = list(map(int, input().split()))
# 累積和 cumulative sum
ans = 0
cumul = [0]
for i, l in enumerate(L):
d = cumul[-1] + l
if d > X:
#print(i, d)
ans = i + 1
break
cumul.append(d)
else:
ans = N + 1
#print(cumul)
print(ans) |
p03000 | s554567239 | Accepted | N, X = map(int, input().split())
L = list(map(int, input().split()))
d = 0
ans = 1
for i in range(N):
d += L[i]
if d <= X:
ans += 1
else:
break
print(ans) |
p03000 | s301040542 | Accepted | n,x = map(int, input().split())
l = list(map(int,input().split()))
d = [0]
for i in range(n):
d.append(d[i]+l[i])
print(sum([j <= x for j in d])) |
p03000 | s017870652 | Accepted | n, x = map(int, input().split())
#print("n:%d" %n)
#print("x:%d" %x)
l = list(map(int, input().split()))
sum = 0
b = 1;
for i in range(n):
sum = sum + l[i]
if(sum > x):
print(b)
break
else:
if(i == n-1):
print(n+1)
break
else:
b=b+1 |
p03000 | s527440945 | Accepted | 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) |
p03000 | s342687232 | Accepted | n,x = map(int,input().split())
li = list(map(int,input().split()))
d = 0
count = 0
for i in range(len(li)):
d += li[i]
if x >= d:
count += 1
else:
break
print(count+1) |
p03000 | s474391088 | Accepted | from sys import exit
n,x=map(int,input().split())
L=list(map(int,input().split()))
p=0
res=1
for l in L:
p+=l
if p>x:
print(res)
exit()
res+=1
print(res) |
p03000 | s115165107 | Accepted | def main():
N, X = (int(x) for x in input().split())
L = [int(x) for x in input().split()]
D = [0]
for i in range(1, N+1):
a = D[i - 1] + L[i - 1]
if a <= X:
D.append(a)
else:
break
print(len(D))
if __name__ == "__main__":
main()
|
p03000 | s179015859 | Accepted | n,x = map(int,input().split())
L = list(map(int,input().split()))
cnt = 0
d = 0
for i,l in enumerate(L):
if d +L[i]<=x:
d += L[i]
else:
print(i+1);exit()
print(n+1)
|
p03000 | s835629554 | Accepted | n,x = map(int,input().split())
l = list(map(int,input().split()))
count = 1
sum = 0
for i in range(n):
sum += l[i]
if sum <= x:
count += 1
print(count) |
p03000 | s930616825 | Accepted | import itertools
import math
n, x = map(int, input().split())
l = list(map(int, input().split()))
d = 0
count = 0
i = 1
while d <= x and i <= n:
d = d + l[i - 1]
count += 1
i += 1
if d <= x:
count += 1
print(count) |
p03000 | s907723943 | Accepted | 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
elif i == N:
ans = N + 1
print(ans) |
p03000 | s856269298 | Accepted | n,x=map(int,input().split())
ls=list(map(int,input().split()))
a=1
d=0
for l in ls:
d+=l
if d<=x:
a+=1
else:
break
print(a)
|
p03000 | s566405354 | Accepted | n,x=map(int,input().split())
l=map(int,input().split())
cn=1
ln=0
for i in l:
ln+=i
if ln>x:
break
cn+=1
print(cn) |
p03000 | s734551230 | Accepted | n,x = map(int, input().split())
l = list(map(int, input().split()))
d = 0
times = 1
for i in range(n):
d += l[i]
if d > x:
break
times += 1
print(times) |
p03000 | s098254235 | Accepted | n,x=map(int,input().split())
l=list(map(int,input().split()))
d=[0]
count=0
for i in range(n):
d.append(d[i]+l[i])
for c in d:
if c<=x:
count+=1
print(count) |
p03000 | s437917389 | Accepted | #130
n,x = map(int, input().split())
l = list(map(int, input().split()))
res = 1
sm = 0
for i in range(0,n):
if sm + l[i] <= x:
res += 1
sm += l[i]
print(res)
|
p03000 | s803128116 | Accepted | n,x=map(int,input().split())
l=list(map(int,input().split()))
a=0
i=0
ans=1
while a+l[i]<=x:
ans+=1
a=a+l[i]
i+=1
if i+1>n:
break
print(ans) |
p03000 | s979183554 | Accepted | n,x = map(int,input().split())
bound = list(map(int,input().split()))
cnt = 1
pos = 0
for i in range(n):
pos += bound[i]
if pos <= x:
cnt += 1
if pos > x:
break
print(cnt) |
p03000 | s852981229 | Accepted | n,x=map(int,input().split())
l=list(map(int,input().split()))
d=0
cnt=1
for i in range(0,n):
d=d+l[i]
if d > x:
break
else:
cnt+=1
print(cnt) |
p03000 | s079613819 | Accepted | def main():
n, x = map(int, input().split())
l = list(map(int, input().split()))
sum = 0
for idx, i in enumerate(l):
sum += i
if sum > x:
print(idx + 1)
break
else:
print(n + 1)
if __name__ == '__main__':
main() |
p03000 | s451322878 | Accepted | n,x = map(int,input().split())
l = list(map(int,input().split()))
d = 0
c = 1
for i in l:
d += i
if(d <= x):c += 1
else:break
print(c)
|
p03000 | s716125449 | Accepted | N, X = map(int, input().split())
L = list(map(int, input().split()))
D = 0
count = 1
for i in L:
D += i
if D <= X:
count += 1
print(count)
|
p03000 | s042834927 | Accepted | # nは跳ねる回数 d1 = 1 dn+1 = dn + ln
n,x = map(int,input().split())
l = list(map(int,input().split()))
d = 0
count = 1
for y in range(n):
d = d + l[y]
if d <= x:
count += 1
else:
break
print(count)
|
p03000 | s249088059 | Accepted | N, X = map(int, input().split())
arr = list(map(int, input().split()))
ans =1
height=0
for i in range(N):
height += arr[i]
if height > X:
break
ans += 1
print(ans)
|
p03000 | s128398263 | Accepted | [n, x] = map(int, input().split())
l = list(map(int, input().split()))
pos = 0
cnt = 1
for i in range(n):
pos = pos + l[i]
if pos <= x:
cnt += 1
else:
break
print(cnt) |
p03000 | s059161544 | Accepted | from itertools import accumulate
N, X = map(int, input().split())
L = list(map(int, input().split()))
acc = [0] + list(accumulate(L))
cnt = 0
for x in acc:
if x <= X:
cnt += 1
print(cnt) |
p03000 | s372097314 | Accepted | line = input()
n, x = [int(i) for i in line.split()]
line = input()
l = [int(j) for j in line.split()]
if n>1:
coord=0
s=2
for k in range(len(l)-1):
if l[k] + l[k+1] + coord <= x :
s+=1
coord = coord+l[k]
print(s)
else:
print("2")
|
p03000 | s684156344 | Accepted | N,X = map(int,input().split())
L = list(map(int,input().split()))
curCoord = 0
n = 1
while (curCoord<=X):
n = n+1
if (n>N+1):
break
else:
curCoord = curCoord+L[n-2]
print(n-1) |
p03000 | s375939099 | Accepted | N, X = list(map(int, input().split()))
L = list(map(int, input().split()))
pos = 0
ans = 1
for i in range(N):
pos += L[i]
if pos <= X:
ans += 1
print(ans)
|
p03000 | s257893433 | Accepted | n, x = (int(x) for x in input().split())
l = list(map(int, input().split()))
d = 0
num = 0
for i in range(n + 1):
d = 0 if i == 0 else d + l[i-1]
if d <= x:
num = num + 1
print(num)
|
p03000 | s908954807 | Accepted | def LI():
return [int(s) for s in input().split()]
N,X = LI()
L_s = LI()
D = [0]*(N+1)
count = 1
for i in range(1,N+1):
D[i] = D[i-1] + L_s[i-1]
if D[i] <= X:
count += 1
print(count) |
p03000 | s367661117 | Accepted | N,X = map(int,input().split())
L = [int(i) for i in input().split()]
D =[]
D.append(0)
x = 0
for i in range(N):
x += L[i]
D.append(x)
ans = 0
for i in range(N+1):
if D[i] <= X:
ans += 1
print(ans)
|
p03000 | s853877510 | Accepted | n,x=map(int,input().split())
l=list(map(int,input().split()))
s=0
count=1
for i in range(n):
s+=l[i]
if(s>x):
break
count+=1
print(count) |
p03000 | s044584336 | Accepted | from itertools import accumulate, takewhile
N, X = map(int, input().split())
print(len(list(takewhile(lambda x: x <= X, accumulate(map(int, input().split()))))) + 1)
|
p03000 | s710651464 | Accepted | import bisect
N, X = map(int, input().split())
L = list(map(int, input().split()))
D = [0]
for l in L:
D.append(l+D[-1])
print(bisect.bisect_right(D, X)) |
p03000 | s531652090 | Accepted | N, X = map(int, input().split())
L = list(map(int, input().split()))
bound = []
for _ in range(N+1):
bound.append(0)
for i in range(1,N+1):
bound[i] = bound[i-1]+L[i-1]
ans = 0
for i in range(N+1):
if bound[i] <= X:
ans += 1
else:
break
print(ans) |
p03000 | s219173073 | Accepted | n,x=[int(x) for x in input().rstrip().split()]
l=[int(x) for x in input().rstrip().rsplit()]
cnt=1
now=0
for i in l:
now+=i
if now<=x:
cnt+=1
else:
break
print(cnt) |
p03000 | s298290010 | Accepted | N, X = map(int, input().split())
L = list(map(int, input().split()))
ans = 1
d = 0
for i in range(N):
d += L[i]
if d <= X:
ans += 1
print(ans) |
p03000 | s668435447 | Accepted | n, x = map(int, input().split())
L = list(map(int, input().split()))
dis = 0
ans = 1
for i in range(n):
dis += L[i]
if dis > x:
dis -= L[i]
break
ans += 1
print(ans) |
p03000 | s419771220 | Accepted | #B
n,x = map(int,input().split())
l = list(map(int,input().split()))
D = [0]
tmp = 0
for i in l:
tmp += i
D.append(tmp)
D = [i for i in D if i <= x]
print(len(D)) |
p03000 | s729158274 | Accepted | n,x = map(int,input().split())
L = list(map(int,input().split()))
ans = 1
r = 0
for l in L:
r += l
if x < r:
print (ans)
exit ()
else:
ans += 1
print (ans)
|
p03000 | s358525343 | Accepted | n, x = map(int, input().split())
data = [0] + list(map(int, input().split()))
count = 0
tmp = 0
for d in data:
tmp += d
if tmp <= x:
count += 1
# print(tmp)
print(count) |
p03000 | s271475688 | Accepted | n,x = map(int,input().split())
l_lst = list(map(int,input().split()))
b = 0
sum_l = 0
for l in l_lst:
b+=1
sum_l += l
if sum_l > x:
break
if sum_l <= x:
b+=1
print(b)
|
p03000 | s682270668 | Accepted | N, X = map(int, input().split())
L = list(map(int, input().split()))
x = 0
ans = 1
for i in range(N):
x += L[i]
if x > X:
break
else:
ans += 1
print(ans)
|
p03000 | s448939790 | Accepted | n, x = map(int, input().split())
l = [int(i) for i in input().split()]
d = 0
c = 0
for i in l:
d += i
if d <= x:
c += 1
print(c+1) |
p03000 | s801323464 | Accepted | n, x = map(int,input().split())
l = list(map(int,input().split()))
d = 0
count = 1
for i in range(n):
d += l[i]
if d <= x:
count += 1
else:
exit
exit
print(count) |
p03000 | s121663569 | Accepted | n,x = map(int, input().split())
lis = list(map(int, input().split()))
p = [0]
for i in range(1,n+1):
p.append(p[i-1]+lis[i-1])
cnt = 0
for j in p:
if j <= x:
cnt += 1
else:
break
print(cnt) |
p03000 | s632592035 | Accepted | n,x = map(int,input().split())
L = list(map(int,input().split()))
cnt = 0
for i in range(n+1):
if sum(L[a] for a in range(i)) <= x:
cnt += 1
print(cnt)
|
p03000 | s625771689 | Accepted | N, X = map(int, input().split())
L = list(map(int, input().split()))
D = 0
cnt = 1
for l in L:
D = D + l
if D > X:
break
cnt +=1
print(cnt) |
p03000 | s456788856 | Accepted | N, X = map(int, input().split())
*L, = map(int, input().split())
ans = 1
d = 0
for l in L:
if d + l <= X:
ans += 1
d += l
else:
break
print(ans)
|
p03000 | s991529566 | Accepted | n,m=map(int,input().split())
a=list(map(int,input().split()))
ans=0
for i in range(n):
ans+=a[i]
if ans>m:
break
if ans<=m:
print(n+1)
else:
print(i+1) |
p03000 | s218051644 | Accepted | #b
n,x=map(int, input().split())
l = list(map(int, input().split()))
d = 0
c = 1
for i in l:
d += i
if d > x:
break
c += 1
print(c) |
p03000 | s285678574 | Accepted | import bisect
N,X=map(int,input().split())
L=list(map(int,input().split()))
for i in range(N-1):
L[i+1]+=L[i]
print(bisect.bisect_left(L,X+1)+1) |
p03000 | s362286177 | Accepted | N, X = map(int, input().split())
L = list(map(int, input().split()))
a = 0
ans = N + 1
for i in range(N):
a += L[i]
if a > X:
ans = i + 1
break
print(ans) |
p03000 | s945625562 | Accepted | N, X = map(int, input().split())
L = list(map(int, input().split()))
ans = 1
now = 0
for i in range(N):
now += L[i]
if now <= X:
ans += 1
else:
break
print(ans)
|
p03000 | s944483985 | Accepted | n,x = map(int,input().split())
l = list(map(int,input().split()))
ans = 1
bounce = 0
for i in range(n):
bounce += l[i]
if bounce <= x:
ans += 1
print(ans) |
p03000 | s309287401 | Accepted | n, x = map(int, input().split())
l = list(map(int, input().split()))
d=[0]
for i in range(1, n+1):
d.append(d[-1]+l[i-1])
print(len([i for i in d if i <= x])) |
p03000 | s844662809 | Accepted | n,x = map(int,input().split())
l = list(map(int,input().split()))
l2 = [0]*(n+1)
for i in range(n):
l2[i+1] = l2[i]+l[i]
ans= 0
for i in l2:
if i<=x:
ans += 1
else:
break
print(ans) |
p03000 | s482733308 | Accepted | import bisect
N,X=map(int,input().split())
L=list(map(int,input().split()))
D=[0]
for i in range(N):
D.append(D[i]+L[i])
print(bisect.bisect_right(D,X)) |
p03000 | s783967315 | Accepted | n,x = map(int, input().split())
l = list(map(int, input().split()))
num = 1
d = 0
for i in range(n):
d += l[i]
if d <= x:
num += 1
print(num) |
p03000 | s297087722 | Accepted | def q2():
N, X = (int(i) for i in input().split())
L = [int(i) for i in input().split()]
D = [0]
for i in range(1, N+1):
D.append(D[i-1] + L[i-1])
ans = 0
for d in D:
if d <= X:
ans += 1
print(ans)
if __name__ == '__main__':
q2()
|
p03000 | s815325285 | Accepted | n, x = map(int, input().split())
l = list(map(int, input().split()))
ans = 1
p = 0
for i in range(n):
p += l[i]
if p <= x:
ans += 1
print(ans)
|
p03000 | s658126471 | Accepted | n,x = map(int, input().split())
l = list(map(int, input().split()))
ans = 1
t = 0
for i in l:
t += i
if t <= x:
ans += 1
else:
break
print(ans) |
p03000 | s599425098 | Accepted | n , x = map(int,input().split())
L =list(map(int,input().split()))
ans = 1
D = [0]*(n+2)
for i in range(2,n+2):
D[i] = D[i-1] + L[i-2]
if D[i] <=x:
ans+=1
print(ans) |
p03000 | s645713696 | Accepted | n, x = [int(x) for x in input().split()]
l = [int(x) for x in input().split()]
cnt = 1
current = 0
for z in l:
if current + z <= x:
cnt += 1
current += z
else:
break
print(cnt) |
p03000 | s299107038 | Accepted | import itertools
import bisect
N, X=map(int, input().split())
L=list(map(int, input().split()))
print(bisect.bisect_right(list(itertools.accumulate(L)), X)+1) |
p03000 | s599048307 | Accepted | n,x = map(int,input().split())
l = list(map(int,input().split()))
ans = 1
s = 0
for i in range(n):
s += l[i]
if s <= x:
ans += 1
print(ans)
|
p03000 | s945033300 | Accepted | n, x = map(int, input().split())
l = list(map(int, input().split()))
ans = 1
d = 0
for i in range(n):
d += l[i]
if d <= x:
ans += 1
print(ans) |
p03000 | s844805247 | Accepted | a, b = map(int, input().split())
l = list(map(int, input().split()[:a]))
res = 1
d = 0
res= [0]
for item in l:
res.append(d + item)
d += item
filtered_res = list(filter(lambda x: x <= b, res))
print(len(filtered_res)) |
p03000 | s803789211 | Accepted | N,X = map(int,input().split())
Ls = list(map(int,input().split()))
D = 0
ans = 1
for i in range(N):
D += Ls[i]
if D <= X:
ans += 1
else:
break
print(ans) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.