上一页 1 ··· 11 12 13 14 15
摘要: 分治的思想包括了三个基本的步骤:1.分解;2.解决;3.合并。归并排序最主要的就是“合并”。 1 //分治算法 2 #include 3 #define infinite 32767 4 5 //合并 6 void Merge(int *A,int p,int q,int r) 7 { 8 int n1,n2,*L,*R,i,j,k; 9 n1=q-p+1;10 n2=r-q;11 L=new int[n1+1];12 R=new int[n2+1];13 for(i=0;i<n1;i++)14 L[i]=A[p... 阅读全文
posted @ 2013-11-15 17:13 偶尔会寂寞 阅读(155) 评论(0) 推荐(0) 编辑
摘要: Flying to the MarsTime Limit: 5000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 8799Accepted Submission(s): 2879Problem DescriptionIn the year 8888, the Earth is ruled by the PPF Empire . As the population growing , PPF needs to find more land for the newborns . 阅读全文
posted @ 2013-11-14 19:50 偶尔会寂寞 阅读(182) 评论(0) 推荐(0) 编辑
摘要: FatMouse' TradeTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 35608Accepted Submission(s): 11680Problem DescriptionFatMouse prepared M pounds of cat food, ready to trade with the cats guarding the warehouse containing his favorite food, JavaBe 阅读全文
posted @ 2013-11-14 16:49 偶尔会寂寞 阅读(164) 评论(0) 推荐(0) 编辑
上一页 1 ··· 11 12 13 14 15