including practice
# | User | Rating |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3823 |
3 | Benq | 3738 |
4 | Radewoosh | 3633 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3390 |
10 | gamegame | 3386 |
# | User | Contrib. |
---|---|---|
1 | cry | 164 |
1 | maomao90 | 164 |
3 | Um_nik | 163 |
4 | atcoder_official | 160 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 157 |
8 | TheScrasse | 154 |
8 | Dominater069 | 154 |
8 | nor | 154 |
including practice
Here's another method. Let's assume the maximum digit of number x is p.For example, the maximum digit of 260d7 is d(13).
If the binary form of number x contains 2^p ,then x will get a decrease after those steps.Otherwise,it not.
Now you see that only p matters the result.We can enumerate the p and form a dp[i][0/1][0/1], which means IN THE FIRST i DIGITS,whether x<L or x=L and whether the p has appeared in x.We can enumerate the next digit to transfer it.If the current digit we enumerate contains 2^p,we just simply discuss about it.
Time Complexity:O(T*16*16*2*2*16)
Code:24938218
Name |
---|