# | User | Rating |
---|---|---|
1 | tourist | 3993 |
2 | jiangly | 3743 |
3 | orzdevinwang | 3707 |
4 | Radewoosh | 3627 |
5 | jqdai0815 | 3620 |
6 | Benq | 3564 |
7 | Kevin114514 | 3443 |
8 | ksun48 | 3434 |
9 | Rewinding | 3397 |
10 | Um_nik | 3396 |
# | User | Contrib. |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 155 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
10 | djm03178 | 152 |
Name |
---|
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. Usedp[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)
i guess dp[curr][abs(l-d)] takes care of this. if d=5,then l=4,5,6 and the dp states will be dp[9][1],dp[10][0],dp[11][1]. if i am incorrect please correct me!
in the example below func reaches island 1138 with L = 92 first, and for abs(100-92) == 8 remembers result 1. Then func reaches island 1138 with L = 108 and returns answer 1 because abs(100-108) == 8. It's wrong.
n = 2, d = 100
1138
1138+109
your answer is 1, but it's 2.
Thanks so much ..got it:)