asifthegreat's blog

By asifthegreat, history, 2 months ago, In English,

I was solving problems in light online judge , and got "output Limit Exceeded" ! but I still don't know about it . Can you please tell me what does it mean ? and when it happens ? problem link :http://www.lightoj.com/volume_showproblem.php?problem=1212 my code : https://paste.ubuntu.com/25534441/

 
 
 
 
  • Vote: I like it  
  • -5
  • Vote: I do not like it  

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

I believe the problem lies in the line :

ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

In LightOJ never use this fast i/o. It can give you incorrect results. Just use cin/cout or scanf/printf.

»
2 months ago, # |
  Vote: I like it +10 Vote: I do not like it

1) Never mix scanf with std::cin if you use sync_with_stdio.

2) Don't copy paste code without reading in documentation what it does.