Блог пользователя majinboo

Автор majinboo, 5 лет назад, По-английски

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

  • Проголосовать: нравится
  • -2
  • Проголосовать: не нравится

»
5 лет назад, # |
  Проголосовать: нравится +8 Проголосовать: не нравится

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.