3 1 12 6 4 3 10 9
2 * When $a = (1,12,6)$, we can let, for example, $b = (4,3,10,9)$ to make the arrangement good. * When $a = (6,12,1)$, we can let, for example, $b = (10,9,4,3)$ to make the arrangement good. * When $a$ is one of the other four ways, no rearrangement of the back row (that is, none of the possible $24$ candidates of $b$) makes the arrangement good. Thus, the answer is $2$.
1 5 1 10
0
10 189330739 910286918 802329211 923078537 492686568 404539679 822804784 303238506 650287940 1 125660016 430302156 982631932 773361868 161735902 731963982 317063340 880895728 1000000000 707723857 450968417
3542400
{
"problem": {
"name": "Ex - Group Photo",
"description": {
"content": "$(2N+1)$ people are forming two rows to take a group photograph. There are $N$ people in the front row; the $i$\\-th of them has a height of $A_i$. There are $(N+1)$ people in the back row; the $i$\\-th",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "abc313_h"
},
"statements": [
{
"statement_type": "Markdown",
"content": "$(2N+1)$ people are forming two rows to take a group photograph. There are $N$ people in the front row; the $i$\\-th of them has a height of $A_i$. There are $(N+1)$ people in the back row; the $i$\\-th...",
"is_translate": false,
"language": "English"
}
]
}