Submission #726995

#TimeUsernameProblemLanguageResultExecution timeMemory
726995beaconmcCoins (BOI06_coins)Pypy 3
70 / 100
923 ms46820 KiB
n,k = map(int, input().split()) coins = [] have = [] for i in range(n): a,b = map(int, input().split()) coins.append(a) have.append(b) ans = 0 sum = 0 for i in range(len(coins)-1): if have[i]==0 and sum + coins[i] < coins[i+1] and sum+coins[i] < k: ans += 1 sum += coins[i] print(ans) print(k-sum)
#Verdict Execution timeMemoryGrader output
Fetching results...