POJ2299归并排序
发布时间:2020-12-14 02:23:08 所属栏目:大数据 来源:网络整理
导读:C - Ultra-QuickSort(7.2.2)(7.2应用排序算法编程的实验范例) Crawling in process... Crawling failed Time Limit: 7000 MS???? Memory Limit: 65536 KB???? 64bit IO Format: %I64d %I64u Submit Status Description In this problem,you have to anal
C - Ultra-QuickSort(7.2.2)(7.2应用排序算法编程的实验范例)
Crawling in process...
Crawling failed
Time Limit:7000MS???? Memory Limit:65536KB???? 64bit IO Format:%I64d & %I64u
Submit
Description Ultra-QuickSort produces the output Your task is to determine how many swap operations Ultra-QuickSort needs to perform in order to sort a given input sequence. Input
The input contains several test cases. Every test case begins with a line that contains a single integer n < 500,000 -- the length of the input sequence. Each of the the following n lines contains a single integer 0 ≤ a[i] ≤ 999,999,the i-th input sequence element. Input is terminated by a sequence of length n = 0. This sequence must not be processed.
Output
For every input sequence,your program prints a single line containing an integer number op,the minimum number of swap operations necessary to sort the given input sequence.
Sample Input 5 9 1 0 5 4 3 1 2 3 0 Sample Output 6 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |