2 5
352 Consider the case $a = 1, 3, 1, 3, 1$ for example. * When the least significant bit of each element of $a$ is set to $0$, $a = 0, 2, 0, 2, 0$; * When the second least significant bit of each element of $a$ is set to $0$, $a = 1, 1, 1, 1, 1$; * When the least two significant bits of each element of $a$ are set to $0$, $a = 0, 0, 0, 0, 0$. In all of the cases above and the case when Snuke does no operation to change $a$, we can sort the sequence by repeatedly swapping adjacent elements that differ in exactly one bit. Thus, this sequence has the property: if used in the game, there is always a way for Takahashi to sort the sequence in ascending order regardless of Snuke's operations.
2020 530
823277409
{
"problem": {
"name": "Sorting Game",
"description": {
"content": "Takahashi and Snuke came up with a game that uses a number sequence, as follows: * Prepare a sequence of length $M$ consisting of integers between $0$ and $2^N-1$ (inclusive): $a = a_1, a_2, \\ldots",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 3000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "nomura2020_f"
},
"statements": [
{
"statement_type": "Markdown",
"content": "Takahashi and Snuke came up with a game that uses a number sequence, as follows:\n\n* Prepare a sequence of length $M$ consisting of integers between $0$ and $2^N-1$ (inclusive): $a = a_1, a_2, \\ldots...",
"is_translate": false,
"language": "English"
}
]
}