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

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

this is my code HERE

i hacked with this test case "etr"
when i run this code in eclipse the answer is "YES"
but in CodeForces the answer is "NO"
what's the reason .
thanks
  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

15 лет назад, скрыть # |
Rev. 3  
Проголосовать: нравится 0 Проголосовать: не нравится

Usually when I face this kind of prob, the most likely reason there is some uninitialized variable that you are using later. Uninitialized variable act differently depending on compiler.

15 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится
if (sz(ss) > 2 && ss.find(nounM, siz - 3) != -1) [line 72]
siz = sz(ss) - 1 [line 65]

So, if ss = "etr" then siz will be 2 and siz - 3 will be -1. Change line 65 to siz = sz(ss) and fix similar errors.