上一页 1 ··· 7 8 9 10 11 12 13 14 下一页

2015年1月28日

摘要: 食物链Description动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。有人用两种说法对这N个动物所构成的食物链关系进行描述:第一种说法是"1 X Y",表... 阅读全文

posted @ 2015-01-28 16:00 LLGemini 阅读(199) 评论(0) 推荐(0) 编辑

2014年12月27日

摘要: C. Crazy TownCrazy Town is a plane on which there are n infinite line roads. Each road is defined by the equation aix + biy + ci = 0, where ai and bi ... 阅读全文

posted @ 2014-12-27 16:24 LLGemini 阅读(177) 评论(0) 推荐(0) 编辑

2014年11月25日

摘要: 冒泡排序: 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 阅读(246) 评论(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 阅读(258) 评论(0) 推荐(0) 编辑

2014年11月24日

摘要: 这题看别人的。就是那么诚实。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 阅读(269) 评论(0) 推荐(0) 编辑

2014年11月3日

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

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

2014年11月2日

摘要: //求幂集 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 阅读(182) 评论(0) 推荐(0) 编辑

2014年10月30日

摘要: 如何构造HuffmanTree? Huffman算法: (1)根据给定的n个权值{w1, w2, ...,wn}构成n棵二叉树集合 阅读全文

posted @ 2014-10-30 15:19 LLGemini 阅读(112) 评论(0) 推荐(0) 编辑

2014年10月21日

摘要: C++容器类C++中的容器类包括“顺序存储结构”和“关联存储结构”,前者包括vector,list,deque等;后者包括set,map,multiset,multimap等。 若需要存储的元素数在编译器间就可以确定,可以使用数组来存储,否则,就需要用到容器类了。 1、vector连续存储结构,每个... 阅读全文

posted @ 2014-10-21 19:37 LLGemini 阅读(302) 评论(0) 推荐(0) 编辑

2014年10月9日

摘要: Alice's Print ServiceTime Limit:2 Seconds Memory Limit:65536 KBAlice is providing print service, while the pricing doesn't seem to be reasonable, so p... 阅读全文

posted @ 2014-10-09 20:54 LLGemini 阅读(250) 评论(0) 推荐(0) 编辑

上一页 1 ··· 7 8 9 10 11 12 13 14 下一页