5 5 1 2 3 4 5
1 2 3 5 4 The operations are performed as follows. * Swap the ball with $1$ written on it with the next ball to the right. Now, the balls have integers $2,1,3,4,5$ written on them, from left to right. * Swap the ball with $2$ written on it with the next ball to the right. Now, the balls have integers $1,2,3,4,5$ written on them, from left to right. * Swap the ball with $3$ written on it with the next ball to the right. Now, the balls have integers $1,2,4,3,5$ written on them, from left to right. * Swap the ball with $4$ written on it with the next ball to the right. Now, the balls have integers $1,2,3,4,5$ written on them, from left to right. * Swap the ball with $5$ written on it with the next ball to the left, since it is the rightmost ball. Now, the balls have integers $1,2,3,5,4$ written on them, from left to right.
7 7 7 7 7 7 7 7 7
1 2 3 4 5 7 6
10 6 1 5 2 9 6 6
1 2 3 4 5 7 6 8 10 9
{
"problem": {
"name": "Adjacent Swaps",
"description": {
"content": "$N$ balls are lined up in a row from left to right. Initially, the $i$\\-th ($1 \\leq i \\leq N$) ball from the left has an integer $i$ written on it. Takahashi has performed $Q$ operations. 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": "abc250_c"
},
"statements": [
{
"statement_type": "Markdown",
"content": "$N$ balls are lined up in a row from left to right. Initially, the $i$\\-th ($1 \\leq i \\leq N$) ball from the left has an integer $i$ written on it.\nTakahashi has performed $Q$ operations. The $i$\\-th ...",
"is_translate": false,
"language": "English"
}
]
}