摘要: http://poj.org/problem?id=2299 1 #include 2 int a[500005]; 3 long long count; 4 5 void merge(int first,int mid,int last) 6 { 7 int s1,s2,f1,f2,i,k,f[500005]; 8 s1=first; 9 s2=mid+1;10 f1=mid;11 f2=last;12 k=0;13 while(s1<=f1&&s2<=f2)14 {15 if(a[s1]<a[s2])16 ... 阅读全文
posted @ 2013-07-29 20:50 海东青飞吧! 阅读(160) 评论(0) 推荐(0) 编辑
摘要: Fence RepairTime Limit:2000MSMemory Limit:65536KTotal Submissions:19664Accepted:6237DescriptionFarmer John wants to repair a small length of the fence around the pasture. He measures the fence and finds that he needsN(1 ≤N≤ 20,000) planks of wood, each having some integer lengthLi(1 ≤Li≤ 50,000) uni 阅读全文
posted @ 2013-07-29 17:25 海东青飞吧! 阅读(225) 评论(0) 推荐(0) 编辑
摘要: DescriptionAccounting for Computer Machinists (ACM) has sufferred from the Y2K bug and lost some vital data for preparing annual report for MS Inc.All what they remember is that MS Inc. posted a surplus or a deficit each month of 1999 and each month when MS Inc. posted surplus, the amount of surplus 阅读全文
posted @ 2013-07-29 15:12 海东青飞吧! 阅读(146) 评论(0) 推荐(0) 编辑
摘要: Language:Ubiquitous ReligionsTime Limit:5000MSMemory Limit:65536KTotal Submissions:20242Accepted:9938DescriptionThere are so many different religions in the world today that it is difficult to keep track of them all. You are interested in finding out how many different religions students in your uni 阅读全文
posted @ 2013-07-29 11:25 海东青飞吧! 阅读(229) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #define N 255 4 int f[N][N]; 5 int main() 6 { 7 int i,j,n; 8 while(~scanf("%d",&n)) 9 {10 memset(f,0,sizeof(f));11 f[0][0]=1;12 f[1][0]=1;13 f[2][0]=3;14 if(n=0;i--)36 printf("%d",f[n][i]);37 printf(... 阅读全文
posted @ 2013-07-29 10:49 海东青飞吧! 阅读(247) 评论(0) 推荐(0) 编辑