# | User | Rating |
---|---|---|
1 | tourist | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 161 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | awoo | 154 |
8 | Dominater069 | 154 |
10 | luogu_official | 150 |
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:)