phantom11's blog

By phantom11, 11 years ago, In English

I was trying to solve the Problem H of the last contest.[problem link]

But I keep on getting Memory Limit Exceeded.Please some one tell me why this is happening .I am bringing here 3 codes. One from which I have learnt which gets accepted and the other two are mine. Please tell me why I get MLE in both cases and why 'B' got passed in test case 5 by making small change in 'A' (only change is made during the last for loop where printing is done) .

mfv code -> [link] accepted

case A ->[Link] fails on test case 5

case B ->[Link] fails on test 15

Please clear my concepts so that I dont face these issues in future.Thank You

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