#P8553. 醒来
醒来
Background
“Where did the fireworks we once envied go? The friends we trusted have drifted away.
What did I insist on when I was young? Do you still remember?”
Thinking back to what we looked like as children, we are already very different from who we are now; but thinking about ourselves yesterday, there seems to be little difference from today. These unintentional changes have made us into someone else.
Problem Description
Herta uses a sequence of length to describe how her personality has changed. But Herta has a poor memory: she can no longer remember , and only remembers two non-negative integers , where .
However, she still remembers that:
- , and all are distinct. In other words, is a permutation of .
- For all , $\operatorname{popcount}(a_i \mathbin{\mathrm{xor}} a_{i+1})=1$. In other words, two adjacent numbers in differ by exactly one bit in binary.
Please tell her one possible , or tell her that such an does not exist.
Input Format
A single line with two non-negative integers .
Output Format
On the first line, output Yes if there is a solution, otherwise output No. Case does not matter.
If you output Yes, you may output your construction in one of the following two formats:
- Output one line with numbers, representing the permutation you constructed.
- First output one number, representing the first number of your permutation. Then output a string of length . For the -th character, if the -th and -th numbers in your permutation differ by , you should output the -th lowercase English letter, i.e.
(char)('a'+k).
Note: If you use Format 1, you may not be able to pass the last two subtasks. If you receive the judging result from UKE, please consider changing the output format of your answer.
[Scoring Method]
This problem uses a custom checker to validate your output.
If your judgment about whether a solution exists is wrong, you will get no points.
If your judgment about existence is correct, you can get of the points; if no solution exists or you provide a correct construction, you can get the remaining of the points.
0 7
Yes
0 1 3 2 6 7 5 4
0 7
yEs
0 abacaba
0 7
yes
3 5
No
Hint
[Sample Explanation #1, #2, #3]
Sample outputs #1 and #2 correspond to the same sequence, i.e. . Both can get of the score for that test point.
Sample output #3 can get of the score for that test point.
[Constraints]
For all testdata, it is guaranteed that .
Let .
| Subtask ID | Special Constraints | Points | |
|---|---|---|---|
| — | |||
| — | |||
| — |
: Guaranteed that .
: Guaranteed that is an integer power of .
: Guaranteed that is even and is odd.
: This subtask has 5 test points, generated randomly from all solvable cases with .
Even if she keeps changing, Herta may still be the same as she was in childhood.
Translated by ChatGPT 5