Welcome![Sign In][Sign Up]
Location:
Downloads SourceCode Windows Develop Other
Title: chexiangchongzu Download
 Description: Description in an old-fashioned train station next to a bridge deck horizontal rotation around the center of the river piers. A station workers found that the length of the bridge can accommodate up to two cars, if the bridge is rotated 180 degrees, you can exchange the position of the two compartments adjacent to, this way you can rearrange the order of the compartment. He is responsible for the compartments of the bridge will stop the car number in ascending order. After his retirement, the railway station decided to automate this work, one of the important work is to compile a program, enter the order in which the initial compartments calculated minimum number of steps will be able to sort the compartment. Input Input file has two rows of data, the first line is the compartment total number N (not more than 10000), and the second line is N different number indicates the order in which the initial carriage. Output a data, which is the minimum number of rotations. Sample Input 4 4 3 2
 Downloaders recently: [More information of uploader ]
 To Search:
File list (Check if you may need any files):
 

车厢重组\车厢重组\车厢重组.cpp
........\车厢重组
车厢重组
    

CodeBus www.codebus.net