problem_id
stringclasses
100 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
6
806
p03000
s505092486
Accepted
# B n,x = map(int, input().split()) d = 0 count = 1 l = list(map(int, input().split())) for i in range(n): d += l[i] if d <= x: count+=1 print(count)
p03000
s192334612
Accepted
n, x = map(int, input().split()) L = list(map(int, input().split())) ans = 1 d = 0 for l in L: d = d + l if d <= x: ans += 1 else: break print(ans)
p03000
s267081143
Accepted
n,x = map(int,input().split(" ")) l = list(map(int,input().split(" "))) y = 0 for i in l: y += i if y <= x: print(n+1) else: count = 1 d = 0 j = 0 while d < x: d += l[j] j += 1 if d <= x: count += 1 print(count)
p03000
s132249155
Accepted
icase=0 if icase==0: n,x=map(int,input().split()) l=list(map(int,input().split())) d=0 for i in range(n): d=d+l[i] if d>x: print(i+1) break if d<=x: print(n+1)
p03000
s676028691
Accepted
n,x=map(int,input().split()) *l,=map(int,input().split()) t=[0] for i in range(n): d=l[i]+t[-1] t.append(d) ans=[j for j in t if j <= x] print(len(ans))
p03000
s823227967
Accepted
N,X=map(int,input().split()) L=list(map(int,input().split())) count=0 dist=0 L.append(0) i=0 while dist<=X and count<=N: dist+=L[count] count+=1 #print(dist) print(count)
p03000
s688664782
Accepted
from itertools import accumulate n,x = map(int,input().split()) lst_l = [0] + list(map(int,input().split())) lst_wa = list(accumulate(lst_l)) cnt = 0 for i in lst_wa: if i <= x: cnt += 1 print(cnt)
p03000
s773952822
Accepted
n, x = map(int, input().split()) (*l,) = map(int, input().split()) a = [0] for i in l: if a[-1] + i > x: break a.append(a[-1] + i) print(len(a))
p03000
s958304505
Accepted
import sys N,X = map(int,input().split()) array = list(map(int,input().split())) count = 1 point = 0 for I in range(len(array)): point += array[I] if point <= X: count += 1 else: break print(count)
p03000
s927521556
Accepted
n,x = list(map(int,input().split())) l = list(map(int,input().split())) l.insert(0,0) r = 0 n_l = [] for i in l: r += i n_l.append(r) ans = 0 for i in n_l: if i <= x: ans += 1 print(ans)
p03000
s996200472
Accepted
N,L=map(int,input().split()) A=list(map(int,input().split())) hane=1 count=0 for i in range(N): count+=A[i] hane+=1 if count==L: break elif count>L: hane-=1 break print(hane)
p03000
s596466868
Accepted
N,X=map(int,input().split()) L=list(map(int,input().split())) mem=0; ans=1 for i in L: mem+=i if mem<=X: ans+=1 print(ans)
p03000
s195503392
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
s164435097
Accepted
def resolve(): n,x=map(int, input().split()) l=list(map(int, input().split())) num=1 zahyou=0 for i in range(n): zahyou+=l[i] if zahyou<=x: num+=1 print(num) resolve()
p03000
s907904460
Accepted
N,X = map(int,input().split()) L = list(map(int,input().split())) tmp = 0 cnt = 1 for i in range(N): tmp += L[i] if(tmp <= X): cnt += 1 print(cnt)
p03000
s106966532
Accepted
#!/usr/bin/env python3 import numpy as np def main(): N, X = map(int, input().split()) L_list = list(map(int, input().split())) L_sum = np.cumsum(L_list) print(np.where(L_sum <= X)[0][-1] + 2) if __name__ == '__main__': main()
p03000
s542482141
Accepted
def main(): n, x, *ls = map(int, open(0).read().split()) d=0 cou=1 for l in ls: d += l if d <= x: cou+=1 else: return(cou) return n+1 if __name__ == '__main__': print(main())
p03000
s022260484
Accepted
n,x = map(int, raw_input().split(' ')) ais = map(int, raw_input().split(' ')) count,cur,i = 1,0, 0 res = [] while(i < len(ais)): cur += ais[i] if cur <= x: count+=1 else: break i +=1 print count #print len([e for e in res if e <= x])
p03000
s510607987
Accepted
import sys input = sys.stdin.readline def I(): return int(input()) def MI(): return map(int, input().split()) def LI(): return list(map(int, input().split())) n,x=MI() ls=LI() dp=[0 for i in range(n+1)] for i in range(n): dp[i+1]=dp[i]+ls[i] #print(dp) count=0 for d in dp: if d<=x: count+=1 print(coun...
p03000
s750784485
Accepted
N, X = map(int, input().split()) L = list(map(int, input().split())) ans = 1 d = 0 for l in L: if d + l <= X: d += l ans += 1 else: break print(ans)
p03000
s278621856
Accepted
n,x=map(int,input().split()) L=list(map(int,input().split())) cnt=0 ans=1 for l in L: cnt+=l if cnt>x: break ans+=1 print(ans)
p03000
s685682219
Accepted
N, X = map(int, input().split(' ')) L_ls = map(int, input().split(' ')) D, cnt = 0, 1 for L in L_ls: D += L if D > X: break cnt += 1 print(cnt)
p03000
s432854957
Accepted
N, X = map(int,input().split()) lst = list(map(int,input().split())) cnt = 1 now = 0 for i in range(N): l = now + lst[i] if l > X: break else: cnt += 1 now = l print(cnt)
p03000
s782601083
Accepted
n, x = map(int, input().split()) l = list(map(int, input().split())) d = 0 cnt = 0 for i in range(n): if d <= x: cnt += 1 d += l[i] if d <= x: cnt += 1 print(cnt)
p03000
s664828239
Accepted
n,k=map(int, input().split(' ')) a=list(map(int, input().split(' '))) ans,s=0,0 for i in a: if s<=k: ans+=1 else: break s+=i if s<=k: ans+=1 print(ans)
p03000
s862158560
Accepted
n, x = map(int, input().split()) l = list(map(int, input().split())) ans = 1 d = 0 for i in l: d = d + i if d <= x: ans += 1 print(ans)
p03000
s107521153
Accepted
import bisect import sys input = sys.stdin.readline N,X = list(map(int,input().split())) L = list(map(int,input().split())) bn = [0] for i in range(N): bn.append(bn[-1]+L[i]) print(bisect.bisect_right(bn,X))
p03000
s515607510
Accepted
n,x=map(int,input().split()) li=list(map(int,input().split())) ans=1 l=0 for i in li: l+=i if l>x: break ans+=1 print(ans)
p03000
s729040722
Accepted
import sys sys.setrecursionlimit(10**6) #a = int(input()) #b = list(map(int, input().split())) n, x = map(int, input().split()) #s = input() #s,t = input().split() # readline = sys.stdin.readline l = [int(i) for i in readline().split()] #ab = [[int(i) for i in readline().split()] for _ in range(n)] ans = 1 height = 0...
p03000
s693433833
Accepted
# B - Bounding N, X = map(int, input().split()) L = [int(l) for l in input().split()] D = 0 cnt = 1 for i in range(N): D = D + L[i] if D <= X: cnt += 1 print(cnt)
p03000
s235186252
Accepted
N,X = list(map(int,input().split())) L_list = list(map(int,input().split())) ans = 1 current = 0 for i in range(N): current += L_list[i] if current <= X: ans += 1 print(ans)
p03000
s728469940
Accepted
from itertools import accumulate from bisect import * N, X = map(int, input().split()) L = list(map(int, input().split())) S = list(accumulate([0]+L)) print(bisect_right(S,X))
p03000
s230878757
Accepted
from collections import defaultdict def mapt(fn, *args): return tuple(map(fn, *args)) def Input(): return mapt(int, input().split(" ")) def main(): n, x = Input() l = Input() d = defaultdict(int) d[0] = 0 ans = 0 for i in range(1, n+1): d[i] = d[i-1] + l[i-1] for i in...
p03000
s876178615
Accepted
n, x = map(int, input().split()) l = list(map(int, input().split())) d = 0 count = 1 for v in l: dv = d + v # print(dv) if dv > x: break count += 1 d += v print(count)
p03000
s914167225
Accepted
N,X = map(int,input().split()) L = list(map(int,input().split())) count = 1 posi = 0 for i in L: posi +=i if(posi<=X): count+=1 else: break print(count)
p03000
s314836405
Accepted
N, X = map(int, input().split()) Ls = list(map(int, input().split())) ans = 1 D = 0 for L in Ls: D += L ans += D <= X print(ans)
p03000
s696594659
Accepted
N,X = map(int,input().split()) list = list(map(int, input().split())) cnt = 1 sum = 0 for i in list: sum += i if sum <= X: cnt += 1 print(cnt)
p03000
s899591229
Accepted
n,x=map(int,input().split()) l=[int(x) for x in input().rstrip().split()] now=0 cnt=1 for i in range(n): now+=l[i] if x<now: break cnt+=1 print(cnt)
p03000
s185997362
Accepted
n, x = map(int, input().split()) Ls = list(map(int, input().split())) ans = 1 temp = 0 for l in Ls: temp += l if temp <= x: ans += 1 print(ans)
p03000
s528269532
Accepted
n,x=map(int,input().split()) l=list(int(i) for i in input().split()) s=[] for i in range(len(l)+1): t=sum(l[:i]) if t <= x: s.append(t) print(len(s))
p03000
s048261631
Accepted
n,x= input().split() b_list= list(map(int, input().split())) temp = 0 counter = 1 for i in range(int(n)): temp += b_list[i] if (temp<=int(x)): counter +=1 else: break print(counter)
p03000
s719623592
Accepted
n,x=map(int,input().split()) l=list(map(int,input().split())) ans=1 cursum=0 for i in range(n): cursum+=l[i] if cursum <= x: ans+=1 print(ans)
p03000
s000474410
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]) if d[i+1]>x: print(i+1) break else: print(n+1)
p03000
s685855636
Accepted
n, x = map(int, input().split()) l = [int(i) for i in input().split()] b = 0 c = 1 for i in range(n): if b + l[i] <= x: b += l[i] c += 1 else: break print(c)
p03000
s447855288
Accepted
url = "https://atcoder.jp//contests/abc130/tasks/abc130_b" def main(): n,x = list(map(int, input().split())) lis = list(map(int, input().split())) lis.insert(0, 0) count = 0 pos = 0 for l in lis: pos += l count += 1 if pos > x: print(count-1) exi...
p03000
s747012921
Accepted
n, X = map(int, input().split()) l = list(map(int, input().split())) sumList = [0] for i in range(n): s = sumList[i]+l[i] if s > X: break sumList.append(s) print(len(sumList))
p03000
s477577517
Accepted
import itertools N, X = [int(_) for _ in input().split()] L = [int(_) for _ in input().split()] bounce_positions = list(itertools.accumulate([0]+L)) ans = sum(x <= X for x in bounce_positions) print(ans)
p03000
s466701948
Accepted
n,x=map(int,input().split()) l=list(map(int,input().split())) d=0 cnt=1 for i in range(1,n+1): d=d+l[i-1] if d<=x: cnt+=1 print(cnt)
p03000
s594771461
Accepted
N, X = map(int, input().split()) L = list(map(int, input().split())) cnt = 1 total = 0 for i in range(N): total += L[i] if total <= X: cnt += 1 else: break print(cnt)
p03000
s339941318
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
s497628459
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.append(d[i - 1] + l[i - 1]) for i in range(len(d)): if d[i] <= x: count += 1 print(count)
p03000
s273450164
Accepted
n,x = map(int,input().split()) l = list(map(int,input().split())) d , count = 0 , 0 for i in range(0,n): d += l[i] #print(d) if d<=x: count+=1 print(count+1)
p03000
s169865528
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
s339381091
Accepted
n, x = map(int, input().split()) l = list(map(int, input().split())) d = 0 p = 1 for i in range(n): d += l[i] if d <= x: p += 1 print(p)
p03000
s985761747
Accepted
n,x = map(int,input().split()) ls = list(map(int, input().split())) d = 0 ans = 0 for l in ls: if d <= x: ans += 1 d += l if d <= x: ans += 1 print(ans)
p03000
s772167155
Accepted
n,x = map(int,input().split()) L = list(map(int,input().split())) d = [0]*(n+1) d[0] = 0 for i in range(1,n+1): d[i] = d[i-1] +L[i-1] print(len([i for i in d if i<=x]))
p03000
s390185170
Accepted
import bisect N, X = map(int, input().split()) l = list(map(int, input().split())) d = [-1]*(N+1) #0-index #バウンドする位置を格納するリスト d[0] = 0 #バウンドする初期値は0 for i in range(1, N+1): d[i] = d[i-1] + l[i-1] #print(d) #print('left:', bisect.bisect_left(d, X)) #print('right:', bisect.bisect_right(d, X)) print(bisect.bisect_rig...
p03000
s711679370
Accepted
n,x=map(int,input().split()) l=list(map(int,input().split())) fly=0 count=1 for i in range(100): fly+=l[i] if fly<=x: count+=1 else: break print(count)
p03000
s648231662
Accepted
n,x=map(int,input().split()) L=list(map(int,input().split())) ans = 1 cnt = 0 for l in L: cnt += l if x >= cnt: ans += 1 print(ans)
p03000
s450788551
Accepted
from bisect import bisect_right N, X = map(int, input().split()) L = list(map(int, input().split())) s = [0] * (N+1) for i in range(N): s[i+1] = s[i] + L[i] pos = bisect_right(s, X) print(pos)
p03000
s446544856
Accepted
import sys read=sys.stdin.buffer.readline N,X=map(int,read().split()) L=list(map(int,read().split())) ans=1 res=0 for l in L: res+=l if res<=X: ans+=1 else: break print(ans)
p03000
s012827244
Accepted
import bisect from itertools import accumulate N, X = map(int, input().split()) L = list(map(int, input().split())) Lsum = list(accumulate(L)) ind = bisect.bisect_right(Lsum, X) print(ind+1)
p03000
s597288242
Accepted
#!/usr/bin/env python3 import sys input = iter(sys.stdin.read().splitlines()).__next__ N, X = map(int, input().split()) L = list(map(int, input().split())) P = [0] for d in L: P.append(P[-1] + d) res = len( [1 for x in P if x <= X] ) print(res)
p03000
s631237483
Accepted
n, x = map(int, input().split()) l = [int(s) for s in input().split()] pos = 0 count = 1 for i in range(n): pos += l[i] if pos > x: break count += 1 print(count)
p03000
s294816676
Accepted
n, x = (int(i) for i in input().split()) list_l = [int(j) for j in input().split()] tmp = 0 count = 0 for i in range(0, n + 1): if i == 0: pass else: tmp += list_l[i - 1] if tmp > x: break count += 1 print(count)
p03000
s458484847
Accepted
n,x=map(int,input().split()) #ls=[0]+[int(x) for i in input().split()] ls=list(map(int,input().split())) #d=[] #d.append(0) ans=0 d=0 for i in ls: d=d+i if d>x: break ans +=1 print(ans+1)
p03000
s085412999
Accepted
n,x=map(int,input().split()) l=list(map(int,input().split())) ans=0 k=0 for i in range(n): k+=l[i] if k<=x: ans+=1 print(ans+1)
p03000
s345468235
Accepted
import sys import itertools def IL(): return map(int,sys.stdin.readline().rstrip().split()) def Main(): n,x = IL() l = [0]+list(IL()) l = list(itertools.accumulate(l)) ans = 0 for rep in l: if x<rep: break ans += 1 print(ans) return if __name__=='__main__': Main()
p03000
s981222193
Accepted
import bisect n,x=map(int,input().split()) L=list(map(int,input().split())) lst=[0]*(n+1) for i in range(1, n+1): lst[i]=lst[i-1]+L[i-1] print(bisect.bisect_right(lst,x))
p03000
s200319718
Accepted
n,x = map(int,input().split()) l = list(map(int,input().split())) count = 1 x1 = 0 for i in range(n): if x1 + l[i] <= x: count += 1 x1 += l[i] else: print(count) exit() print(count)
p03000
s270377326
Accepted
n,x = map(int,input().split()) li = list(map(int,input().split())) cnt = 0 num = 1 for i in li: if cnt + i > x: break else: cnt += i num += 1 print(num)
p03000
s130218589
Accepted
n,x=map(int,input().split()) L=[int(_) for _ in input().split()] S_L=[0] count=1 for i in range(n): S_L.append(S_L[-1]+L[i]) if S_L[-1]<=x: count+=1 else: print(count) break else:print(n+1)
p03000
s531785403
Accepted
#k = int(input()) #s = input() #a, b = map(int, input().split()) #s, t = map(str, input().split()) #l = list(map(int, input().split())) #l = [list(map(int,input().split())) for i in range(n)] n,x = map(int, input().split()) l = list(map(int, input().split())) temp = [] temp.append(0) last = 0 for i in range(n): ...
p03000
s559138402
Accepted
n, x = [int(i) for i in input().split()] l = [0] + [int(i) for i in input().split()] total = 0 cnt = 0 for i in l: total += i if total <= x: cnt += 1 else: break print(cnt)
p03000
s605502563
Accepted
N,X=map(int,input().split()) L=[int(i) for i in input().split()] count=1 dis=0 for t in L: dis=dis+t if dis<=X: count+=1 else: break print(count)
p03000
s670837322
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
s954804122
Accepted
n, x = map(int, input().split()) L = list(map(int, input().split())) point = 0 ans = 1 for l in L: point += l if point > x: break ans += 1 print(ans)
p03000
s659258561
Accepted
N, X = map(int,input().split()) L = list(map(int,input().split())) cnt = 0 D = [0] for i in range(N): D.append(D[i]+L[i]) l = [d for d in D if d <= X] print(len(l))
p03000
s930341729
Accepted
n,x=map(int,input().split()) l=list(map(int,input().split())) b=0 cnt=0 for i in l: b+=i cnt+=1 if b>x: print(cnt) exit() print(n+1)
p03000
s223420581
Accepted
n,x=map(int,input().split()) l=list(map(int,input().split())) d=0 ans=1 i=0 for i in range(n): d+=l[i] if d<=x: ans+=1 #print(d) else: break print(ans)
p03000
s232775270
Accepted
n, x = map(int, input().split()) l = list(map(int, input().split())) d = 0 c = 1 for i in range(1, n + 1): d += l[i - 1] if d <= x: c += 1 else: break print(c)
p03000
s193958414
Accepted
n,x = map(int,input().split()) l = list(map(int,input().split())) n,c = 0,1 for i in l: n+=i if(n<=x): c+=1 else: break print(c)
p03000
s156829562
Accepted
N,X=map(int,input().split()) L=list(map(int,input().split())) l=[0] s=0 for i in range(N): s+=L[i] if s>X: break l.append(s) print(len(l))
p03000
s602775986
Accepted
N, X = list(map(int, input().split())) L = list(map(int, input().split())) D = 0 a = 1 for i in range(N): D = D + L[i] if D <= X: a += 1 else: break print(a)
p03000
s248132178
Accepted
n,x=map(int,input().split()) l=list(map(int,input().split())) D=0 y=1 if x==0: print(1) else: for i in range(n): D+=l[i] if D<=x: y+=1 print(y)
p03000
s899297457
Accepted
n, x = list(map(int, input().split())) l = list(map(int, input().split())) c, p = 0, 0 while c < n: if p + l[c] <= x: p += l[c] c += 1 else: break print(c + 1)
p03000
s700767920
Accepted
n,x = map(int,input().split()) li = list(map(int,input().split())) dist = 0 for i,d in enumerate(li,2): dist += d if dist > x: i -= 1 break print(i)
p03000
s705960807
Accepted
import sys def MI(): return map(int,sys.stdin.readline().rstrip().split()) def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) #空白あり N,X = MI() L = LI() a = 0 ans = 1 for i in range(N): a += L[i] if a <= X: ans += 1 print(ans)
p03000
s400381042
Accepted
def main(): from itertools import takewhile N, X = map(int, input().split()) *L, = map(int, input().split()) def accumulate(a): s = 0 yield s for x in L: s += x yield s ans = len(tuple(takewhile(lambda s: s <= X, accumulate(L)))) print(ans) i...
p03000
s694326743
Accepted
n, x = map(int, input().split()) l = [int(i) for i in input().split()] p = 0 for i in range(n): p += l[i] if p > x: print(i + 1) break else: print(n + 1)
p03000
s886795797
Accepted
N,X = map(int, input().split()) l = list(map(int,input().split())) count = 1 d = 0 for i in range(N): d = d + l[i] if d <= X: count += 1 print(count)
p03000
s475281287
Accepted
a,b=map(int,input().split()) arr=list(map(int,input().split())) c=1 s=0 for i in range(a): s+=arr[i] if s<=b: c+=1 else: break print(c)
p03000
s425807440
Accepted
N,X = map(int,input().split()) L = list(map(int,input().split())) counter = 1 total = 0 for l in L: total+=l if(total <=X):counter+=1 print(counter)
p03000
s980907371
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]) ans = 0 for dd in d: if dd <= x: ans += 1 print(ans)
p03000
s599475542
Accepted
N, X = map(int, input().split()) L = list(map(int, input().split())) d = 0 count = 0 for i in range(N): d += L[i] if X < d: count = i + 1 break if count == 0: print(N + 1) else: print(count)
p03000
s895944229
Accepted
N,X = map(int,input().split()) L =[0] + list(map(int,input().split())) D = [0 for i in range(N+2)] cnt = 1 for i in range(2,N+2): D[i] = D[i-1] + L[i-1] if D[i] > X: break else: cnt += 1 print(cnt)
p03000
s332518332
Accepted
numList1 = list(map(int, input().split())) numList2 = list(map(int, input().split())) add = 0 result = 1 cood = [] for i in range(0, len(numList2)): add += numList2[i] cood.append(add) for i in cood: if i <= numList1[1]: result += 1 else: continue print(result)
p03000
s315376424
Accepted
def solve(): N,X = map(int,input().split()) L = list(map(int, input().split())) D = 0 count = 1 for i in range(N): D += L[i] count += 1 if D <= X else 0 print(count) if __name__ == '__main__': solve()
p03000
s891818698
Accepted
from sys import stdin def main(): #入力 readline=stdin.readline N,X=map(int,readline().split()) L=list(map(int,readline().split())) S=[0]*(N+1) for i in range(1,N+1): S[i]+=S[i-1]+L[i-1] res=0 for i in range(N+1): if S[i]<=X: res+=1 else: br...
p03000
s114401169
Accepted
n, x = map(int, input().split()) a = [ int(x) for x in input().split() ] cnt = 1 s = 0 for aa in a: s += aa if s <= x: cnt += 1 print(cnt)