3 1 2 3
2
There are $4$ ways to divide $A=(1,2,3)$ into non-empty contiguous subsequences, as follows.
* $(1)$, $(2)$, $(3)$
* $(1)$, $(2,3)$
* $(1,2)$, $(3)$
* $(1,2,3)$
$\prod_{i=1}^{k} (\max(B_i)-\min(B_i))$ for these divisions are $0$, $0$, $0$, $2$, respectively. The sum of them, $2$, should be printed.4 1 10 1 10
90
10 699498050 759726383 769395239 707559733 72435093 537050110 880264078 699299140 418322627 134917794
877646588 Be sure to print the sum modulo $998244353$.
{
"problem": {
"name": "Divide a Sequence",
"description": {
"content": "Given is a sequence $A$ of $N$ numbers. There are $2^{N-1}$ ways to divide $A$ into non-empty **contiguous** subsequences $B_1,B_2,\\ldots,B_k$. Find the value below for each of those ways, and print t",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "abc234_g"
},
"statements": [
{
"statement_type": "Markdown",
"content": "Given is a sequence $A$ of $N$ numbers.\nThere are $2^{N-1}$ ways to divide $A$ into non-empty **contiguous** subsequences $B_1,B_2,\\ldots,B_k$. Find the value below for each of those ways, and print t...",
"is_translate": false,
"language": "English"
}
]
}