5 5 2 1 3 2 2 3 3 1 5 3 5
16 There are $16$ sequences that can be achieved. For example, you can achieve $a=(2,1,1,1,1)$ in the following manner: * Choose $p=(4,1,2,3,5)$ and $w=(1,2,1,2,1)$ * The $1$\-st operation changes $a$ into $(1,1,1,1,1)$ * The $2$\-nd operation changes $a$ into $(2,2,2,1,1)$ * The $3$\-rd operation changes $a$ into $(2,1,2,1,1)$ * The $4$\-th operation changes $a$ into $(2,1,2,1,1)$ * The $5$\-th operation changes $a$ into $(2,1,1,1,1)$
20 30 20 1 14 1 7 1 16 3 13 1 17 4 8 2 11 4 12 9 14 3 15 11 19 1 13 4 15 8 19 3 17 15 18 10 18 1 18 17 19 16 20 1 8 8 15 13 17 1 19 13 19 1 20 6 13 10 12 11 20 17 18
258066445
{
"problem": {
"name": "Modifications",
"description": {
"content": "You have an integer sequence $a=(a_1,a_2,\\cdots,a_N)$ of length $N$. All elements are initially $0$. You are given an integer $C$ and $M$ intervals $([L_1,R_1],[L_2,R_2],\\cdots,[L_M,R_M])$. You will c",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 3000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "agc067_b"
},
"statements": [
{
"statement_type": "Markdown",
"content": "You have an integer sequence $a=(a_1,a_2,\\cdots,a_N)$ of length $N$. All elements are initially $0$.\nYou are given an integer $C$ and $M$ intervals $([L_1,R_1],[L_2,R_2],\\cdots,[L_M,R_M])$.\nYou will c...",
"is_translate": false,
"language": "English"
}
]
}