#P10872. [COTS 2022] 移位 Maliand
[COTS 2022] 移位 Maliand
Background
Translated from Izborne Pripreme 2022 (Croatian IOI/CEOI Team Selection) D1T2. .
Problem Description
Given non-negative integers , construct two sequences such that:
- The lengths of and are .
- contains exactly ones, and contains exactly ones.
- is the minimum among all possible .
Define as follows: after applying any cyclic shifts to and , take the maximum value of , where denotes the bitwise AND operation.
You need to construct and .
Input Format
One line with three integers .
Output Format
The first line contains an integer , which is the minimum value of .
The next two lines describe the sequences and , respectively. There is no need to output spaces between adjacent elements.
If there are multiple solutions, output any one of them.
6 4 3
2
011011
101010
5 2 0
0
01001
00000
10 7 6
5
1101100111
1110001101
Hint
For of the testdata, it is guaranteed that and .
| Subtask ID | Score | Constraints |
|---|---|---|
| No additional constraints |
Scoring:
- If you answer correctly, you can get of the score.
- On this basis, if your satisfy the conditions, you will get the remaining of the score.
- If you only plan to answer the first part, you still need to output any two sequences satisfying conditions 1 and 2, otherwise you are not guaranteed to get any score.
Translated by ChatGPT 5