题目描述
Problem Background
"Where has the envious fireworks gone, and the trusted friends drifted apart.
What did I insist on in my childhood, do you still remember?"
Looking back at my childhood self, I am now vastly different; yet, comparing yesterday's self to today, there is little change. This subtle transformation has made us another person.
Problem Description
Held uses a sequence \( a \) of length \( r-l+1 \) to describe the changes in her personality. However, Held has poor memory and cannot remember \( a \), only the non-negative integers \( l, r \) where \( l < r \).
Nonetheless, she remembers:
- \( l \le a_i \le r \), and \( a_i \) are distinct. In other words, \( a \) is a permutation of \( l \sim r \).
- For all \( 1 \le i \le r-l \), \( \operatorname{popcount}(a_i \mathbin{\mathrm{xor}} a_{i+1})=1 \). In other words, each pair of adjacent numbers in \( a \) differs by exactly one bit in binary representation.
Please tell her a possible \( a \), or inform her that such \( a \) does not exist.
Input Format
A single line containing two non-negative integers \( l, r \).
Output Format
The first line should output Yes if a solution exists, or No if it does not. The case does not matter.
If you output Yes, you can output your construction in one of the following two formats:
- Output a single line with \( r-l+1 \) numbers, representing the constructed permutation.
- Output a number representing the first number of the constructed permutation. Then output a string of length \( r-l \). For the \( i \)-th character, if the \( i \)-th and \( i+1 \)-th numbers in the constructed permutation differ by \( 2^k \), output the \( k+1 \)-th lowercase English letter, i.e.,
(char)('a'+k).
Note that if you use format 1 for output, you may not pass the last two subtasks. If you receive a UKE verdict, consider modifying the format of your answer output.
[Scoring Method]
This problem uses a custom validator to check your output.
If your judgment on the existence of a solution is incorrect, you will not receive any points.
If your judgment on the existence of a solution is correct, you can earn \( 40\% \) of the points; if a solution does not exist or you provide a correct construction, you can earn the remaining \( 60\% \) of the points.
Sample Input and Output
Sample Input #1
0 7
Sample Output #1
Yes
0 1 3 2 6 7 5 4
Sample Input #2
0 7
Sample Output #2
yEs
0 abacaba
Sample Input #3
0 7
Sample Output #3
yes
Sample Input #4
3 5
Sample Output #4
No
Notes
[Sample Explanation #1, #2, #3]
Sample outputs #1 and #2 correspond to the same sequence, namely \( \{ 0, 1, 3, 2, 6, 7, 5, 4 \} \), and both can earn \( 100\% \) of the points for this test case.
Sample output #3 can earn \( 40\% \) of the points for this test case.
[Data Range]
For all data, \( 0 \le l < r \le 10^7 \).
Let \( n = r-l+1 \).
$$ \def\arraystretch{1.5} \begin{array}{c|c|c|c}\hline \textbf{Subtask Number}&\bm{~~~~~~~~n\le~~~~~~~~}&~~~~\textbf{Special Restrictions}~~~~&\textbf{Points}\cr\hline \textsf{1} & 10& &9\cr\hline \textsf{2} & 20& &9 \cr\hline \textsf{3} & 10^5&\textsf{A, B}&10\cr\hline \textsf{4} & 10^5 &\sf A&10\cr\hline \textsf{5} & 2000& \textsf C&25 \cr\hline \textsf{6} & 5\times 10^5&\textsf D&20\cr\hline \textsf{7} & 3\times 10^6&&10\cr\hline \textsf{8} & &&7\cr\hline \end{array} $$
$\textsf A$:Guaranteed \( l=0 \).
$\textsf B$:Guaranteed \( n \) is an integer power of \( 2 \).
$\textsf C$:Guaranteed \( l \) is even, \( r \) is odd.
$\textsf D$:This subtask contains 5 test cases, randomly generated from all data where \( n \ge 2\times 10^5 \) and a solution exists.
Even though Held is constantly changing, she might still be like her childhood self.
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分