8 1 5 3 2 5 2 3 1
2 * Initially, we have $A=(1,5,3,2,5,2,3,1)$. * After replacing every occurrence of $3$ in $A$ with $2$, we have $A=(1,5,2,2,5,2,2,1)$. * After replacing every occurrence of $2$ in $A$ with $5$, we have $A=(1,5,5,5,5,5,5,1)$. In this way, we can make $A$ a palindrome in two operations, which is the minimum needed.
7 1 2 3 4 1 2 3
1
1 200000
0 $A$ may already be a palindrome in the beginning.
{
"problem": {
"name": "KAIBUNsyo",
"description": {
"content": "You are given a sequence of $N$ positive integers: $A=(A_1,A_2, \\dots A_N)$. You can do the operation below zero or more times. At least how many operations are needed to make $A$ a palindrome? * C",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "abc206_d"
},
"statements": [
{
"statement_type": "Markdown",
"content": "You are given a sequence of $N$ positive integers: $A=(A_1,A_2, \\dots A_N)$. You can do the operation below zero or more times. At least how many operations are needed to make $A$ a palindrome?\n\n* C...",
"is_translate": false,
"language": "English"
}
]
}