3 2 1 2 3 3 6 3 3 1 4 2 3 9
10 13 The first query is as follows: * Update $D_3$ to $1$ and $P_3$ to $4$. Now, $D = (1, 2, 1)$ and $P = (3, 6, 4)$. * In the subproblem, one optimal procedure is to complete job $3$ on day $1$, job $2$ on day $2$, and job $1$ on day $3$. The total reward is $10$, so print $10$. The second query is as follows: * Update $D_2$ to $3$ and $P_2$ to $9$. Now, $D = (1, 3, 1)$ and $P = (3, 9, 4)$. * In the subproblem, one optimal procedure is to complete job $3$ on day $1$, job $1$ on day $2$, and job $2$ on day $3$. The total reward is $13$, so print $13$.
5 1 1 2 3 4 5 1000000000 1000000000 1000000000 1000000000 1000000000 1 1 1000000000
5000000000
10 10 6 2 4 1 5 1 6 6 5 3 45 65 71 52 86 52 48 60 40 98 5 6 5 8 4 34 6 7 83 1 3 21 7 5 85 7 4 51 8 2 81 2 7 54 6 1 5 8 6 30
394 379 462 457 459 414 443 479 401 396
{
"problem": {
"name": "Dynamic Scheduling",
"description": {
"content": "You are given two sequences of length $N$: $D=(D_1, D_2, \\dots, D_N)$ and $P=(P_1, P_2, \\dots, P_N)$. Process $Q$ queries in the order they are given. Each query is given in the following format: * ",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 8000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "abc363_g"
},
"statements": [
{
"statement_type": "Markdown",
"content": "You are given two sequences of length $N$: $D=(D_1, D_2, \\dots, D_N)$ and $P=(P_1, P_2, \\dots, P_N)$.\nProcess $Q$ queries in the order they are given. Each query is given in the following format:\n\n* ...",
"is_translate": false,
"language": "English"
}
]
}