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

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

[contest:http://codeforces.net/contest/471] Hey guys,

I'm trying to solve the D problem of the Codeforces Round 269 Div2, I used Z-algorithm for solving it. For the first test case given, the code gives me the correct output when testing on local PC but gives different output when submitted. Anyone has an idea why is this problem ? Thanks This is my submission

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

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

in your last for loop , you're trying to access ZValue[k] , k exceeds the size of the vector , fix your conditions.