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

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

Question — https://codeforces.net/problemset/problem/161/D

Submission — https://codeforces.net/contest/161/submission/278555376

IMO, it should pass the time constraints. Am I missing something?

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

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

try to use int array. not long vector

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

Buddy when you are calling dfs it's complexity is n*k*k... It should be n*k fir sol to work . Why are checking for all k values you only have to check for single k... Dp here is unnecessary

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

    Sorry, there are many mistakes in my above answer. Misread the problem statement. I will try to answer in some time. Please ignore above statement.