mahmoud13's blog

By mahmoud13, history, 45 hours ago, In English

I was solving this problem 2069D\ - Palindrome Shuffle. It is giving me Runtime error on test 2. My idea to solve this problem is to first know how many chars from the beginning of the string equal chars from the end, so these chars don't have to be swapped with any other char. Then in the rest of the string I should use suffix or prefix of the string to make it palindrome. To calculate the answer to the problem, it is just the max distance between the end of the string and a char I used to do the swap. My code is in the spoiler.

Spoiler

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By mahmoud13, history, 15 months ago, In English

I got TLE on Test 6 for a problem of today's contest 1900C - Anji's Binary Tree. This is one of my submissions: 234472915. Thank you in advance for your time!

Full text and comments »

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

By mahmoud13, history, 15 months ago, In English

I was trying to solve this problem 1851E - Nastya and Potions, and I submitted this code 233066590. It's the same logic of the editorial, that's what I think, but it's getting TLE. Can anyone tell me what is the wrong with my code so it's getting this TLE?

Full text and comments »

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