地址:http://acm.split.hdu.edu.cn/showproblem.php?pid=6215 题目: Brute Force Sorting Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 496 Accepted Submission(s): 119 Problem Description Beerus need…
Brute Force Sorting Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 1043 Accepted Submission(s): 272 Problem Description Beerus needs to sort an array of N integers. Algorithms are not Beerus…
Brute Force Sorting Time Limit: 1 Sec Memory Limit: 128 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=6215 Description Beerus needs to sort an array of N integers. Algorithms are not Beerus's strength. Destruction is what he excels. He can destr…
题意:给你长度为n的数组,定义已经排列过的串为:相邻两项a[i],a[i+1],满足a[i]<=a[i+1].我们每次对当前数组删除非排序过的串,合并剩下的串,继续删,直到排序完成. 题解:用双向链表模拟删除过程即可. 具体细节见代码: #include<cstdio> #include<cstring> #define N 200010 using namespace std; int T,n,i,a[N],out[N],next[N],pre[N],r,pos[N],l;…
题目链接 Problem Description Beerus needs to sort an array of N integers. Algorithms are not Beerus's strength. Destruction is what he excels. He can destroy all unsorted numbers in the array simultaneously. A number A[i] of the array is sorted if it sat…