5 5 2 1 2 2
9 * $f(5) = 0$ * $f(2) = 0$ * $f(1) = 0$ * $f(2) = 0$ * $f(2) = 0$ * $f(5,2) = 1$ * $f(2,1) = 1$ * $f(1,2) = 1$ * $f(2,2) = 0$ * $f(5,2,1) = 1$ * $f(2,1,2) = 0$ * $f(1,2,2) = 1$ * $f(5,2,1,2) = 2$ * $f(2,1,2,2) = 1$ * $f(5,2,1,2,2) = 1$ Therefore, the sought answer is $9$.
{
"problem": {
"name": "Make it Palindrome",
"description": {
"content": "For a sequence $X$, let $f(X) =$ (the minimum number of elements one must modify to make $X$ a palindrome). Given a sequence $A$ of length $N$, find the sum of $f(X)$ over all **contiguous** subarrays",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "abc290_e"
},
"statements": [
{
"statement_type": "Markdown",
"content": "For a sequence $X$, let $f(X) =$ (the minimum number of elements one must modify to make $X$ a palindrome).\nGiven a sequence $A$ of length $N$, find the sum of $f(X)$ over all **contiguous** subarrays...",
"is_translate": false,
"language": "English"
}
]
}