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

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

Hi I wrote top-down dp for this problem but my code gets TLE for test case 6 I must change it to bottom-up or there is a trick to don't get TLE?

My code ==> https://codeforces.net/contest/366/submission/56265597

Problem Link ==> https://codeforces.net/contest/366/problem/C

Any type of help is appreciated. Thanks in advance.

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

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

Auto comment: topic has been updated by BanazadehAria (previous revision, new revision, compare).

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

You don't need this map<int,map<int,int> >, I think this is your problem. Take a look to my code and if you have any question tell me :)

My code

Btw, I used map in this and got TLE, that why i changed it.