3 2 3 74 42 54 42 54 74
5 Let $k_1$ and $k_2$ be the $k$ chosen in the first and second iterations, respectively. For instance, if $k_1 = 0$ and $k_2 = 1$, then $A$ changes as follows. * A stable sort by $k_1$\-th ($0$\-th) lowest digit makes $A = (42,74,54)$. * A stable sort by $k_2$\-th ($1$\-st) lowest digit makes $A = (42,54,74)$. Here are all the ways to execute the process and the resulting $A$. * $(k_1, k_2) = (0,0)$: $A = (42,74,54)$. * $(k_1, k_2) = (0,1)$: $A = (42,54,74)$. * $(k_1, k_2) = (0,2)$: $A = (42,74,54)$. * $(k_1, k_2) = (1,0)$: $A = (42,54,74)$. * $(k_1, k_2) = (1,1)$: $A = (42,54,74)$. * $(k_1, k_2) = (1,2)$: $A = (42,54,74)$. * $(k_1, k_2) = (2,0)$: $A = (42,74,54)$. * $(k_1, k_2) = (2,1)$: $A = (42,54,74)$. * $(k_1, k_2) = (2,2)$: $A = (74,42,54)$.
2 1 1 2 3 3 2
0 There is no way to satisfy the condition.
5 100 4 0 12 34 56 78 0 12 34 56 78
982924732
All $4^{100}$ ways satisfy the condition.{
"problem": {
"name": "Random Radix Sort",
"description": {
"content": "For non-negative integers $x$ and $k$, the $k$\\-th lowest digit of $x$ is the remainder when $\\bigl\\lfloor \\frac{x}{10^k}\\bigr\\rfloor$ is divided by $10$. For instance, the $0$\\-th, $1$\\-st, $2$\\-nd, ",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 4000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "arc158_f"
},
"statements": [
{
"statement_type": "Markdown",
"content": "For non-negative integers $x$ and $k$, the $k$\\-th lowest digit of $x$ is the remainder when $\\bigl\\lfloor \\frac{x}{10^k}\\bigr\\rfloor$ is divided by $10$. For instance, the $0$\\-th, $1$\\-st, $2$\\-nd, ...",
"is_translate": false,
"language": "English"
}
]
}