№ | Пользователь | Рейтинг |
---|---|---|
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 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
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 |
Название |
---|
I think you are trying to solve the same problem that are solving here. Check it out, maybe you find the answer there. I couldn't see your code due to technical problems but I solve similar problems using tries too, so I think you are probably on the right way.
I am again getting wrong answer on same type of problem here. I have checked on most of the inputs and it's giving correct answer. My solution is here. please do check this.
Hi, you are considering only the first maximum value that appears, but you can get the same maximum value, with a lexicographic smallest subsequence. Try with this input:
Your output:
Correct output:
I'll give you a hint, write the maximum number in binary, it's going to have at most 20 digits, now it's obvious that you can have only one of each digit in the answer, and having a digit i is better than having digits 1 . . . i-1 since 2^i > 1 + 2 + . . . + 2^(i-1), so now each time try saving the digit with the most value and your done!