dv.jakhar's blog

By dv.jakhar, history, 4 years ago, In English

Hello codeforces here is my code for C1 Prefix Flip(Easy Version) and when I submit it, I get Memory limit exceeded on test 2. Can you help me finding why it is so? as I can't find. Please see my code it doesn't have so many macros, so you get confused. Thanks, I love this community.

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

| Write comment?
»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Try while(s[j]==t[j]&&j>=0)

  • »
    »
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Bro, thanks for your reply, but it didn't help and error remains.

    • »
      »
      »
      4 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      There seems to be some logical error wherein your j never reaches 0. The vector keeps growing and gives you a MLE. Not sure but you can try debugging on these lines