WA in ACM ICPC Latin Regional Contest [Greedy][Editorial]

Revision en3, by proofbycontradiction, 2018-09-26 15:49:03

I am trying to solve Problem M: Counting Marbles. I am writing an editorial in case somebody might need it after me, and I am also trying to ask for help in spotting the error in my code.

Editorial:
We are essentially trying to write the smallest base-365 number with the marbles. So we must minimize the earlier digits as much as possible.

Use a priority queue with the tops of the stack, and whenever you use a marble, remove it from the priority queue and put the next element in the queue instead. Please see my solution for one such implementation.

Help: My solution is able to run on the sample test cases, but I'm getting WA (could somebody take a look at this)?

My solution: https://www.ideone.com/VnKScW
Problem Statement: http://codeforces.com/gym/101889/attachments/download/7471/statements-2017-latam-regional.pdf

EDIT: This editorial is incorrect.

Tags debug, latin america regional, editorial

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English proofbycontradiction 2018-09-26 15:49:03 43 Tiny change: 'al.pdf\n\n' -> 'al.pdf\n\n\n\n**EDIT:** This editorial is incorrect. '
en2 English proofbycontradiction 2018-09-26 13:17:00 18 Tiny change: 'om/VnKScW \nProblem' -> 'om/VnKScW \nProblem'
en1 English proofbycontradiction 2018-09-26 13:15:31 913 Initial revision (published)