Why does my solution not MLE on worst test but MLE on a seemingly less bad test?

Revision en1, by mblazev, 2019-03-06 12:01:37

My hacked solution: https://codeforces.com/contest/1132/submission/50838954

On the worst possible test (test 52):

5000 5000
1 5000
...
1 5000

It just barely passes with >255 mb used. Memory usage is high beceause I fill all of those 5000 vectors with as much as data possible. However, a slightly different test (generated hack):

5000 5000
(randomly choose 1 or 2) 5000
...

Causes MLE. How could this be? Is it possible that generator affects memory usage? It MLE on that same hack upon resubmit though.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English mblazev 2019-03-06 12:01:37 645 Initial revision (published)