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

Автор ash_vs_ash, история, 4 года назад, По-английски

I am continuously getting TLE on "substring search" (question 1 of step 3 ). I tried declaring global variables, tried passing reference to vectors, reduced function calls but nothing worked. According to me, my code is O(nlogn). Can someone please help me in finding why I am getting TLE. Here is the code: https://mirror.codeforces.com/edu/course/2/lesson/2/3/practice/contest/269118/submission/85793528

Полный текст и комментарии »

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

Автор ash_vs_ash, история, 6 лет назад, По-английски

I was trying to solve this problem on Codechef, " https://www.codechef.com/ICOP1904/problems/GRP ". I understand that I have to use DP to solve it and also that I have to maintain two states, but I am unable to figure out how to proceed to solve it. I even looked at some submissions but I am still not sure if I got it completely. Can someone please explain me how to solve the problem. Thanks in advance..

Полный текст и комментарии »

Теги #dp
  • Проголосовать: нравится
  • -18
  • Проголосовать: не нравится