8 ...###.. 20 25 1 1 30 2 1 1
2 There are six ways to perform the first operation, as follows: * Choose sections $1$ and $7$. The trees at sections $4,5,6$ are removed, and you gain a reward of $21$. * Choose sections $1$ and $8$. The trees at sections $4,5,6$ are removed, and you gain a reward of $21$. * Choose sections $2$ and $7$. The trees at sections $4,5,6$ are removed, and you gain a reward of $26$. * Choose sections $2$ and $8$. The trees at sections $4,5,6$ are removed, and you gain a reward of $26$. * Choose sections $3$ and $7$. The trees at sections $4,5,6$ are removed, and you gain a reward of $2$. * Choose sections $3$ and $8$. The trees at sections $4,5,6$ are removed, and you gain a reward of $2$. No matter which operation is performed, all trees are removed, so a second operation cannot be performed. The maximum possible total reward is $26$.
5 .#.#. 211 182 192 182 211
2 The maximum possible total reward is $825$. Note that the goal is not to maximize the reward obtained in the first operation. If you choose sections $1$ and $5$ first, you can gain a reward of $422$, but no operation can be performed afterwards, and the total reward cannot reach $825$.
11 #..#.##.#.. 192 192 192 211 182 192 182 192 182 211 182
3
{
"problem": {
"name": "Forest",
"description": {
"content": "You are given a positive integer $N$, a string $S$ of length $N$ consisting of `#` and `.`, and a length-$N$ sequence of positive integers $R=(R_1,R_2,\\dots,R_N)$. There is a forest with $N$ sections ",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "arc211_c"
},
"statements": [
{
"statement_type": "Markdown",
"content": "You are given a positive integer $N$, a string $S$ of length $N$ consisting of `#` and `.`, and a length-$N$ sequence of positive integers $R=(R_1,R_2,\\dots,R_N)$.\nThere is a forest with $N$ sections ...",
"is_translate": false,
"language": "English"
}
]
}