시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
3 초 | 512 MB | 127 | 40 | 34 | 32.381% |
The members of the No-Weather-too-Extreme Recreational Climbing society completed their 100th successful summit today! To commemorate the occasion, we took a picture of all the members standing together in one row, to use for marketing purposes.
However, the photograph looks messy; as usual, the members refused to order themselves in any kind of aesthetically pleasing way. We will need to reorder the picture.
Figure A.1: This picture has been cut up and pasted back together to solve Sample Input 1.
Our research tells us that having the climbers in ascending (non-decreasing) height order from left to right will be most visually appealing. We must cut up the picture we have and somehow paste it back together in this order.
Find the minimum number of cuts you need to make to put the photograph into ascending order.
The input consists of:
Output the minimum number of cuts needed to rearrange the photograph into any one ascending (non-decreasing) height order from left to right.
11 3 6 12 7 7 7 7 8 10 5 5
4
3 5000000 5500000 7000000
0
12 1 2 2 3 3 1 2 3 4 1 2 3
6
ICPC > Regionals > Europe > Northwestern European Regional Contest > NWERC 2017 A번