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

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

what is the problem in this code to get tle?? https://mirror.codeforces.com/contest/1389/submission/102948197

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

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

Although your code is a little hard for me to read, a quick skim shows that you are checking the value of vis[idx][left][flag] but it doesn't seem that you ever set it. This would render your DP useless since you never use the values you memoize.