# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
727004 | beaconmc | Coins (BOI06_coins) | Pypy 3 | 837 ms | 41460 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
H=print
G=range
F=input
I,C=map(int,F().split())
A=[]
D=[]
for B in G(I):J,K=map(int,F().split());A.append(J);D.append(K)
E=0
sum=0
for B in G(len(A)-1):
if D[B]==0 and sum+A[B]<A[B+1]and sum+A[B]<C:E+=1;sum+=A[B]
if sum+A[-1]<C and D[-1]==0:E+=1;sum+=A[-1]
H(E)
H(C-sum)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |