MdoingIt's blog

By MdoingIt, history, 2 years ago, In English

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

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

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

  • Vote: I like it
  • 0
  • Vote: I do not like it

| Write comment?
»
2 years ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

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