#P9238. [蓝桥杯 2023 省 A] 翻转硬币
[蓝桥杯 2023 省 A] 翻转硬币
Problem Description
Given coins placed in order. At the beginning, only the st coin is facing down, and all other coins are facing up. In each operation, you may choose any integer and flip all coins at positions that satisfy .
Find the minimum number of operations needed to make all coins face up.
Input Format
The input consists of one line containing an integer .
Output Format
Output one line containing an integer, the minimum number of operations.
7
6
1131796
688042
Hint
Scale and assumptions for test cases.
For of the test cases, .
For of the test cases, .
For all test cases, .
Translated by ChatGPT 5