problem_id
stringclasses
100 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
6
806
p03000
s254793345
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[i-1]+l[i-1]) cnt = 0 for j in d: if j <= x: cnt += 1 print(cnt)
p03000
s855004668
Accepted
N, X = map(int, input().split()) L = list(map(int, input().split())) ans = 1 d = 0 for x in L: d = d + x if d <= X : ans += 1 print(ans)
p03000
s729462711
Accepted
N,X = map(int, input().split()) L = list(map(int, input().split())) cnt=1 d=0 for i in range(N): if d+L[i]<=X: cnt+=1 d=d+L[i] else: break print(cnt)
p03000
s449991436
Accepted
n,x = map(int,input().split()) L = list(map(int,input().split())) ans = 1 l = 0 for i in range(n): l += L[i] if l <= x: ans += 1 print(ans)
p03000
s451197997
Accepted
from itertools import accumulate n, x = map(int, input().split()) L = list(map(int, input().split())) C = [0] + list(accumulate(L)) #print(C) cnt = 0 for c in C: if c <= x: cnt += 1 print(cnt)
p03000
s717761310
Accepted
n, x = map(int, input().split()) L = list(map(int, input().split())) val = 0 count = 1 for l in L: val += l if val <= x: count += 1 print(count)
p03000
s043005701
Accepted
#!/usr/bin/env python3 # https://atcoder.jp/contests/abc130/tasks/abc130_b n, x = [int(x) for x in input().split()] li = [int(x) for x in input().split()] li2 = [0] + [sum(li[:i + 1]) for i, n in enumerate(li)] li2 = [n for n in li2 if n <= x] print(len(li2))
p03000
s684101250
Accepted
n,x = map(int,input().split()) l = list(map(int,input().split())) ans = 0 count = 1 for i in range(n): ans = ans + l[i] if ans > x: break count += 1 print(count)
p03000
s102363571
Accepted
n,x=map(int,input().split()) l=list(map(int,input().split())) tmp=0 ans=1 for i in range(n): tmp+=l[i] if tmp<=x: ans+=1 print(ans)
p03000
s935879199
Accepted
from bisect import bisect_right n, x = map(int, input().split()) l = list(map(int, input().split())) d = [0] for i in range(1, n+1): d.append(d[i-1]+l[i-1]) cnt = bisect_right(d, x) print(cnt)
p03000
s143730729
Accepted
import sys input = sys.stdin.readline N, X = map(int, input().split()) a = list(map(int, input().split())) cs = [0] * (N + 1) for i in range(N): cs[i + 1] = cs[i] + a[i] res = N + 1 for i in range(N + 1): if cs[i] > X: res = i break print(res)
p03000
s752144131
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: print(count) exit() print(count)
p03000
s520644884
Accepted
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)
p03000
s137656309
Accepted
N, X = map(int, input().split()) L = list(map(int, input().split())) z = 0 L.insert(0,0) for i in range(len(L)): bound = i+1 z += L[i] if z > X: bound -= 1 break print(bound)
p03000
s589194568
Accepted
N, X = map(int, input().split()) L = list(map(int, input().split())) D = 0 num = 1 while num <= N: D = D + L[num-1] if D > X: print(num) break num += 1 else: print(N+1)
p03000
s645540507
Accepted
n, x = map(int, input().split()) l = list(map(int, input().split())) cnt = 1 position = 0 for i in range(n): position += l[i] if position <= x: cnt += 1 else: break print(cnt)
p03000
s990414634
Accepted
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 print(cnt)
p03000
s939597489
Accepted
N,X = map(int,input().split()) L = list(map(int,input().split())) ans = 1 for i in range(N): if sum(L[:i+1]) <= X: ans += 1 else: break print(ans)
p03000
s859033782
Accepted
arr1 = input().split() n,x = int(arr1[0]),int(arr1[1]) arr2 = input().split() d = 0 count = 1 for i in range(1, n + 1): d += int(arr2[i-1]) if d <= x: count +=1 print(count)
p03000
s106194619
Accepted
n, x = map(int, input().split()) l = list(int(i) for i in input().split()) d = 0 cnt = 1 for i in range(n): d += l[i] if d <= x: cnt += 1 print(cnt)
p03000
s964275426
Accepted
n,x=map(int,input().split()) Len=[int(i) for i in input().split()] ans=n+1 test=0 for i in range(n): test+=Len[i] if test<=x: continue else: ans=i+1 break print(ans)
p03000
s368360412
Accepted
n,x = map(int,input().split()) L = list(map(int,input().split())) s = 0 for i in range(n): s += L[i] if s > x: print(i+1) break else: print(n+1)
p03000
s492902199
Accepted
N,X=map(int,input().split()) L=list(map(int,input().split())) c=1 tmp=0 for i in range(N): tmp += L[i] if tmp <=X: c+=1 print(c)
p03000
s489761850
Accepted
N,X = map(int,input().split()) L = list(map(int,input().split())) count = 1 s = 0 for i in range(N): s += L[i] if s <= X: count += 1 print(count)
p03000
s537973835
Accepted
N, X = map(int, input().split()) Ls = [int(i) for i in input().split()] Ds = [0] for i, l in enumerate(Ls): Ds.append(Ds[i] + l) print(sum([d <= X for d in Ds]))
p03000
s942373229
Accepted
import sys def input(): return sys.stdin.readline().rstrip() def main(): n, x = map(int, input().split()) l = tuple(map(int, input().split())) d = 0 for i in range(1, n+1): d += l[i-1] if d > x: print(i) quit() else: print(n+1) if __name__ == '__mai...
p03000
s285325034
Accepted
from itertools import accumulate n,x = map(int, input().split()) a = [0] + list(map(int, input().split())) print(len([i for i in accumulate(a) if i < x+1]))
p03000
s160565586
Accepted
import itertools import bisect N, X = map(int, input().split()) *L, = map(int, input().split()) A = list(itertools.accumulate(L)) print(bisect.bisect(A, X) + 1)
p03000
s326463290
Accepted
inputted = list(map(int, input().split())) N = inputted[0] X = inputted[1] L = list(map(int, input().split())) x = 0 number_of_bounds = 0 for _i, Li in enumerate(L): number_of_bounds = _i + 1 x += Li if x > X: break if x <= X: number_of_bounds += 1 print(number_of_bounds)
p03000
s267164430
Accepted
x = list(map(int, input().split()))[1] l = list(map(int, input().split())) m = [0] for i in l: if i+m[-1] <= x: m.append(i+m[-1]) else: break print(len(m))
p03000
s333580229
Accepted
n, x = map(int, input().split()) l = list(map(int, input().split())) d = [0] * (n+1) ans = 1 for i in range(1, n+1): d[i] = d[i-1] + l[i-1] if d[i] <= x: ans += 1 print(ans)
p03000
s836312546
Accepted
N, X = map(int, input().split()) L = list(map(int, input().split())) tmp = 0 count = 0 for l in L: if tmp <= X: count += 1 tmp += l if tmp <= X: count += 1 print (count)
p03000
s665567634
Accepted
n, x = list(map(int, input().split())) # a = list(map(int, input().split())) # data = [list(map(int, input().split())) for i in range(n)] # k = int(input()) L = list(map(int, input().split())) # ab_sorted = sorted(ab, key=lambda x: x[0]) #ab = [list(map(int, input().split())) for i in range(n)] # print(min(15*n, 100*(n...
p03000
s177045875
Accepted
n, x = map(int, input().split()) l = list(map(int, input().split())) d = 0 e = 1 for i in l: d = d + i if d <= x: e += 1 print(e)
p03000
s287054589
Accepted
n, x = map(int, input().split()) l = list(map(int, input().split())) cum = [0] * (n+1) for i in range(1, n+1): cum[i] = cum[i-1] + l[i-1] f = True for i in range(n+1): if cum[i] > x: f = False print(i) break if f: print(n+1)
p03000
s441832361
Accepted
n,x=map(int,input().split()) l=list(map(int,input().split())) list=[0] cnt=0 for i in l: i=i+list[cnt] list.append(i) cnt+=1 ans=0 for i in list: if i<=x: ans+=1 print(ans)
p03000
s305734487
Accepted
N,X = map(int,input().split()) L = list(map(int,input().split())) tmp = 0 for i in range(N): tmp = tmp + L.pop(0) if(tmp == X): print(str(i + 2)) exit() elif(tmp > X): print(str(i + 1)) exit() else: pass if(i + 1 == N): print(str(N + 1))
p03000
s329785548
Accepted
import sys input = sys.stdin.readline N, X = map(int, input().split()) A = list(map(int, input().split())) B = [0] cnt = 0 for i in range(N): B.append(B[i]+A[i]) for i in range(len(B)): if B[i] <= X: cnt += 1 print(cnt)
p03000
s409268144
Accepted
n,x = map(int,raw_input().split()) l = map(int,raw_input().split()) d1=0 bou = 1 for i in xrange(n): d1 += l[i] if d1 > x: break else: bou += 1 print bou
p03000
s737161696
Accepted
N,X = map(int,input().split()) L_li = input().split() for i in range(len(L_li)): L_li[i] = int(L_li[i]) D = [0]*(N+1) for i in range(1,N+1,1): D[i] = D[i-1] + L_li[i-1] print(len([i for i in D if i <= X]))
p03000
s358473323
Accepted
N,X = map(int,input().split()) l = list(map(int,input().split())) pos = 0 cnt = 1 for i in range(N): pos += l[i] if pos <= X: cnt += 1 else: break print(cnt)
p03000
s428139327
Accepted
n,x=map(int,input().split()) a=list(map(int,input().split())) cnt=1 now=0 if sum(a)<=x: print(n+1) exit() for i in a: now+=i if now>x: print(cnt) exit() cnt+=1
p03000
s721344239
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
s058441767
Accepted
import numpy as np n, x = [int(_) for _ in input().split()] l = np.cumsum(np.array([int(_) for _ in input().split()])) print(sum([i <= x for i in l])+1)
p03000
s291911396
Accepted
n,x = map(int,input().split()) l = list(map(int,input().split())) count = 0 d = [0] for i in range(1,len(l)+1): d.append(l[i-1]+d[i-1]) for i in range(len(d)): if d[i] <= x: count += 1 print(count)
p03000
s937666549
Accepted
n, x = map(int, input().split()) Ls = list(map(int, input().split())) ans = 1 target = 0 for l in Ls: target += l if target <= x: ans += 1 else: print(ans) exit() print(ans)
p03000
s797235545
Accepted
n,x = map(int,input().split()) l = list(map(int,input().split())) lis = [0] for i in range(n): lis.append(lis[i]+l[i]) print(sum(1 for li in lis if li <= x ))
p03000
s431607091
Accepted
n, x = map(int, input().split()) l = [int(i) for i in input().split()] d = 0 count = 1 for li in l: d += li if d <= x: count += 1 print(count)
p03000
s283947424
Accepted
n,x = map(int,input().split()) l = list(map(int,input().split())) dist = [0]*(n+1) for i in range(1,n+1): dist[i] = dist[i-1] + l[i-1] cnt = 0 for i in range(n+1): if dist[i]<= x: cnt += 1 print(cnt)
p03000
s095684504
Accepted
n, x = map(int, input().split()) L = list(map(int, input().split())) dist = 0 res = 0 for i, l in enumerate(L, 1): dist += l if dist > x: print(i) exit() elif dist == x: print(i + 1) exit() print(n + 1)
p03000
s605516973
Accepted
n, x = map(int, input().split()) a = list(map(int, input().split())) s = 0 t = 1 for i in range(n): s = s + a[i] if s <= x: t += 1 print(t)
p03000
s574752113
Accepted
a,b=map(int,input().split()) list=list(map(int,input().split())) count=0 count2=1 for i in range(a): count+=list[i] if count<=b: count2+=1 print(count2)
p03000
s637398298
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 print(count)
p03000
s511022581
Accepted
N,X=map(int,input().split()) arr=list(map(int,input().split())) a=0 ans=1 for i in range(N): a=a+arr[i] if a<=X: ans+=1 print(ans)
p03000
s097996483
Accepted
""" author : halo2halo date : 9, Jan, 2020 """ import sys # import numpy as np import itertools read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines sys.setrecursionlimit(10 ** 7) N, X, *L = map(int, read().split()) Lcum = itertools.accumulate(L) answer = sum(i ...
p03000
s493163229
Accepted
n, x = map(int, input().split()) l = list(map(int, input().split())) count = 1 point = 0 for i in range(n): point += l[i] if point <= x: count += 1 else: break print(count)
p03000
s329625637
Accepted
def cumsum(xs): result = [0,xs[0]] for x in xs[1:]: result.append(result[-1] + x) return result a,b=map(int,input().split()) c=list(map(int,input().split())) n=cumsum(c) ans=[] for i in range(len(n)): if n[i]<=b: ans.append(n[i]) print(len(ans))
p03000
s281323364
Accepted
n,x = map(int,input().split()) l = list(map(int, input().split())) ans = 1 tmp = 0 for i in l: tmp += i if(tmp > x): break ans += 1 print(ans)
p03000
s500304507
Accepted
n, x = map(int, input().split()) l = list(map(int, input().split())) L = [0] a = 0;b = 0 for i in l: a += i L.append(a) for j in L: if j<=x: b += 1 print(b)
p03000
s992258687
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: break ans += 1 print(ans)
p03000
s201707185
Accepted
n,x=map(int,input().split()) l=list(map(int,input().split())) sumd=0 for i in range(n): sumd+=l[i] if sumd>x: print(i+1) exit() print(i+2)
p03000
s857988023
Accepted
# -*- coding: utf-8 -*- def main(): N, X = map(int, input().split()) L = list(map(int, input().split())) D = 0 ans = 0 if D <= X: ans += 1 for i in L: D += i if D <= X: ans += 1 print(ans) if __name__ == "__main__": main()
p03000
s545349605
Accepted
import sys import math import itertools import bisect from copy import copy from collections import deque,Counter from decimal import Decimal def s(): return input() def k(): return int(input()) def S(): return input().split() def I(): return map(int,input().split()) def X(): return list(input()) def L(): return list(i...
p03000
s696876118
Accepted
n,x = map(int,input().split()) l = list(map(int, input().split())) d = 0 ans = 1 for i in range(n): d = d + l[i] if d <= x : ans +=1 else: break print(ans)
p03000
s948666820
Accepted
#128 b むずい n,x=map(int,input().split()) l=list(map(int,input().split())) z=0 ans=1 for i in l: z+=i if z>x: break ans+=1 print(ans)
p03000
s183429875
Accepted
n, X = map(int, input().split()) l = list(map(int, input().split())) x = 0 c = 1 for i in l: x += i if x <= X: c += 1 else: break print(c)
p03000
s301539516
Accepted
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+1) quit() else: s = s + L[i] i = i + 1 print(i)
p03000
s230253694
Accepted
N, val= list(map(int,input().split())) list = list(map(int,input().split())) d=0 l=[] for i in list: d=d+i l.append(d) count=0 for num in l: if num<=val: count=count+1 print(count+1)
p03000
s464471888
Accepted
N, X = map(int, input().split()) L = list(map(int, input().split())) current = 0 cnt = 1 for l in L: current += l if current > X: break cnt += 1 print(cnt)
p03000
s335888065
Accepted
#ABC 130 B N,X=map(int,input().split()) L= [int(j) for j in input().split()] cnt=0 import numpy as np jump = list(np.cumsum(L)) for j in jump: if j <= X: cnt+=1 print(cnt+1)
p03000
s704743329
Accepted
# ABC 130: B – Bounding N, X = map(int, input().split()) L = [int(s) for s in input().split()] D = [0] for i in range(N): D.append(D[i] + L[i]) print(len([d for d in D if d <= X]))
p03000
s837569742
Accepted
N,X= map(int, input().split()) L=list(map(int, input().split())) D, ans=0, 0 for i in range(N): if D<=X: ans+=1 D+=L[i] else: break if D<=X: ans+=1 print(ans)
p03000
s633767480
Accepted
N,X=map(int,input().split()) L=list(map(int,input().split())) cum,count=0,1 for l in L: cum+=l if cum<=X:count+=1 print(count)
p03000
s230646891
Accepted
n,x=map(int,input().split()) l=list(map(int,input().split())) length=0 i=0 while length<=x and i<=n-1: length+=l[i] i+=1 if length<=x: print(n+1) else: print(i)
p03000
s450469131
Accepted
# input N, X = map(int, input().split()) L = list(map(int, input().split())) # check cnt = 1 D = 0 for i in range(N): D = D + L[i] if D <= X: cnt += 1 print(cnt)
p03000
s571081170
Accepted
n,x=map(int,input().split()) li=list(map(int,input().split())) s=[0] a=0 for i in li: a+=i s.append(a) l=[i for i in s if i<=x] print(len(l))
p03000
s674232193
Accepted
a=list(map(int,input().split())) b=list(map(int,input().split())) no=1 for i in range(1,a[0]): b[i]+=b[i-1] for i in range(0,a[0]): if(a[1]>=b[i]): no+=1 else: break print(no)
p03000
s028119327
Accepted
n,x = map(int,input().split()) l = list(map(int,input().split())) d = [0]*(n+1) ans = 1 for i in range(1,n+1): d[i] = d[i-1]+l[i-1] if x < d[i]: break ans += 1 print(ans)
p03000
s516736421
Accepted
# #!/usr/bin/env python3 # # -*- coding: utf-8 -*- def main(): N, X = map(int, input().split()) L = list(map(int, input().split())) count, D = 1, 0 for l in L: D += l if D <= X: count += 1 print(count) if __name__ == "__main__": main()
p03000
s399935867
Accepted
#ABC 130B n, x = map(int, input().split()) l = list(map(int, input().split())) d = 0 cnt = 1 for i in l: d += i if d <= x: cnt += 1 print(cnt)
p03000
s580943933
Accepted
n, x = map(int,input().split()) l = list(map(int,input().split())) SUM = 0 cnt = 1 for i in l: SUM += i if SUM > x: print(cnt) exit() cnt += 1 else: print(cnt)
p03000
s311635818
Accepted
N, X = map(int, input().split()) L = [int(l) for l in input().split()] if sum(L) <= X: print(N+1) exit() D = 0 ans = 1 for i in range(N): D += L[i] if D <= X: ans += 1 else: print(ans) exit()
p03000
s614234953
Accepted
import sys import math import bisect def main(): n, m = map(int, input().split()) A = list(map(int, input().split())) B = [0] for a in A: B.append(B[-1] + a) ans = 0 for b in B: if b <= m: ans += 1 print(ans) if __name__ == "__main__": main()
p03000
s169534109
Accepted
import bisect n, x = map(int, input().split()) L = list(map(int, input().split())) D = [0] ans = 1 for i in range(1, n+1): d = D[i-1] + L[i-1] D.append(d) if d <= x: ans += 1 else: break print(ans)
p03000
s373910833
Accepted
from itertools import accumulate N, X = [int(x) for x in input().split()] L = list([int(x) for x in input().split()]) a = accumulate(L) for key, i in enumerate(a): if i > X: print(key+1) exit() print(N+1)
p03000
s272645392
Accepted
n,x = map(int, input().split()) l = list(map(int, input().split())) s = 1 d = 0 for i in l: d += i if d <= x: s += 1 print(s)
p03000
s600628016
Accepted
n, x = map(int, input().split()) l = list(map(int, input().split())) distance = 0 bounds = 1 for i in range(n): distance += l[i] if distance <= x: bounds += 1 else: break print(bounds)
p03000
s690738130
Accepted
# coding: utf-8 # Your code here! N,X=map(int, input().split()) List=list(map(int, input().split())) bow=0 cnt=1 for i in range(0,N): bow+=List[i] if bow>X: break else: cnt+=1 print(cnt)
p03000
s812057720
Accepted
N,X = map(int,input().split()) L = list(map(int,input().split())) D = 0 a = 1 for n in range(N): D+=L[n] if D<=X: a+=1 print(a)
p03000
s060955645
Accepted
n,x = map(int,input().split()) l = list(map(int,input().split())) ans = 0 i = 0 for _ in range(n): ans = ans + l[i] if ans <= x: i += 1 print(i+1)
p03000
s444192145
Accepted
n, x = map(int, input().split()) l = list(map(int, input().split())) count = 0 d = 0 for i in range(1, n+1): d += l[i-1] if d <= x: count += 1 else: break print(count+1)
p03000
s265888491
Accepted
N, X = map(int, input().split(' ')) L = list(map(int, input().split(' '))) D = [0 for _ in range(N + 1)] for i in range(1, N + 1): D[i] = D[i-1] + L[i-1] count = 0 for i in range(N + 1): if D[i] <= X: count += 1 print(count)
p03000
s774427925
Accepted
n, x = map(int, input().split()) l = map(int, input().split()) d = 0 ans = 1 for li in l: d += li if d > x: break ans += 1 print(ans)
p03000
s560806812
Accepted
n, x = map(int, input().split()) l = list(map(int, input().split())) sum = 0 ans = 0 for i in range(n): if sum + l[ans] > x: break sum += l[ans] ans += 1 print(ans+1)
p03000
s112154796
Accepted
n, x = map(int, input().split()) L = list(map(int, input().split())) cnt = 1 d = 0 for i in range(len(L)): d += L[i] if d > x: break cnt += 1 print(cnt)
p03000
s769413560
Accepted
n, x = map(int, input().split()) l = list(map(int, input().split())) res = 0 for i in range(n): res += l[i] if x < res: print(i+1) exit() print(i+2)
p03000
s097691125
Accepted
N,X=map(int,input().split()) L=list(map(int,input().split())) for i in range(N-1):L[i+1]+=L[i] count=1 for i in range(N): if L[i]<=X:count+=1 print(count)
p03000
s966842382
Accepted
n, x = list(map(int, input().split())) l = list(map(int, input().split())) d = [0] for i in range(len(l)): d.append(d[i] + l[i]) print(len(list(filter(lambda d_i: d_i <= x, d))))
p03000
s890758403
Accepted
N,X=map(int,input().split()) S=list(map(int,input().split())) count=1 takasa=0 for i in range(N): takasa+=S[i] if takasa<=X: count+=1 print(count)
p03000
s531415669
Accepted
n,x = map(int,input().split()) l = list(map(int,input().split())) ll = 0 ans = 1 for i in l: ll += i if x < ll: print(ans) exit() ans += 1 print(ans)