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

Автор vatayush, 12 лет назад, По-английски

Hey i am tying to solve the problem from yesterday's contest.i am getting WA in 2nd test case.can someone please point a bug.i am unable to find one.here is my code

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

»
12 лет назад, скрыть # |
Rev. 4  
Проголосовать: нравится 0 Проголосовать: не нравится

dp[curr][(abs(l-d))] why do you think it is enough to know only abs(d-L) ? If d = 5 you have to consider both cases with L = 4, and with L = 5 not only one of them. Use dp[curr][360 + l - d]
UPD: there is mistake in the text. "both cases with L = 4, and with L = 6" abs(4-5) == abs(6-5)

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

n = 2, d = 100
1138
1138+109
your answer is 1, but it's 2.