CrocHold's blog

By CrocHold, history, 5 days ago, In English

I was solving https://codeforces.com/contest/1283/problem/D , and created this code https://codeforces.com/contest/1283/submission/118870482 for it, it gives correct outputs, but i'm getting this error- memory limit exceeded at test 5

I researched a bit online and found that removing push_back statements and defining size of 2d vector should help. but when i tried to do that usin a 1 d array...i got a worse memory limit exceeded error.. at test 3 only.

If anyone has any idea whats wrong, kindly do let me know. thanks!

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

»
4 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by CrocHold (previous revision, new revision, compare).

»
4 days ago, # |
  Vote: I like it 0 Vote: I do not like it

I haven't seen the problem, but maybe you could try using a map?