API Response (JSON)
{
"problem": {
"name": "[蓝桥杯 2022 国 A] 最大公约数",
"description": {
"content": "给定一个数组,每次操作可以选择数组中任意两个相邻的元素 $x, y$ 并将其中的一个元素替换为 $\\gcd(x, y)$,其中 $\\gcd(x, y)$ 表示 $x$ 和 $y$ 的最大公约数。请问最少需要多少次操作才能让整个数组只含 $1$。",
"description_type": "Markdown"
},
"platform": "Luogu",
"limit": {
"time_limit": 1000,
"memory_limit": 524288
},
"difficulty": {
"LuoguStyle": "P4"
},
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "LGP8792"
},
"statements": [
{
"statement_type": "Markdown",
"content": "给定一个数组,每次操作可以选择数组中任意两个相邻的元素 $x, y$ 并将其中的一个元素替换为 $\\gcd(x, y)$,其中 $\\gcd(x, y)$ 表示 $x$ 和 $y$ 的最大公约数。请问最少需要多少次操作才能让整个数组只含 $1$。\n\n## Input\n\n输入的第一行包含一个整数 $n$,表示数组长度。\n\n第二行包含 $n$ 个整数 $a_1, a_2,\\dots, a_n$,相邻两个...",
"is_translate": false,
"language": "English"
}
]
}