majinboo's blog

By majinboo, 5 years ago, In English

Can someone help me out with this problem https://www.spoj.com/problems/AIBOHP/. I dont understand why im getting tle in my code: https://ideone.com/i5gpmw

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

»
5 years ago, # |
  Vote: I like it +8 Vote: I do not like it

https://ideone.com/zo4UYo

Here is the AC code, the only change I made was to add an '&' before the s parameter in the count function. This should be done because if you don't put an '&' in front every time you call the function a new instance of a string object will be made which leads to getting TL.