11 2014 档案

摘要:冒泡排序: 1 //复杂度:O(n^2) 2 //比较次数:n*(n-1)/2 ;移动等数量级 3 #include 4 #include 5 #include 6 using namespace std; 7 const int INF = 0x7fffffff; 8 void Bubble_so... 阅读全文

posted @ 2014-11-25 23:58 LLGemini 阅读(252) 评论(0) 推荐(0)

摘要:1 void merge_sort(int *A, int x, int y, int *T) 2 {//x为左端点,y为右端点 3 // 4 if(y-x= y) || (p = m || A[p] > A[q]时,将右半数组元素复制到临时空间19 T[i... 阅读全文

posted @ 2014-11-25 21:22 LLGemini 阅读(269) 评论(0) 推荐(0)

摘要:这题看别人的。就是那么诚实。http://www.cnblogs.com/zhyfzy/p/4117481.htmlB. QueueDuring the lunch break allnBerland State University students lined up in the food co... 阅读全文

posted @ 2014-11-24 19:51 LLGemini 阅读(285) 评论(0) 推荐(0)

摘要:题目有点长,理解题花了不少时间粘下别人的翻译~你的任务是模拟n个程序(按输入顺序编号为1~n)的并行执行。每个程序包含不超过25条语句,格式一共有5种: var=constant(赋值); print var(打印); lock; unlock; end。变量用单个小写字母表示,初始值为0... 阅读全文

posted @ 2014-11-03 21:42 LLGemini 阅读(398) 评论(0) 推荐(0)

摘要://求幂集 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 const int maxn = 10010; 7 typedef list List; 8 List::iterator it; 9 int a[m... 阅读全文

posted @ 2014-11-02 16:22 LLGemini 阅读(197) 评论(0) 推荐(0)