including practice
№ | Пользователь | Рейтинг |
---|---|---|
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 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 157 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
9 | nor | 153 |
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
Название |
---|