2013年7月31日

母函数的一些问题:Ignatius and the Princess III&&Square Coins&&选课时间(题目已修改,注意读题)&&Holding Bin-Laden Captive!

摘要: 首先给出基本的模板:也就是以前所说的公式(不是什么很难的东西)#include using namespace std;const int lmax=10000; int c1[lmax+1],c2[lmax+1];int main(){ int n,i,j,k; while (cin>>n) {for (i=0;i 2 using namespace std; 3 int s(int a,int b) 4 { 5 if(a==1||b==1) return 1; 6 if(ab) return (s(a,b-1)+s(a-b,b)); 9 }10 int main()11 {.. 阅读全文
posted @ 2013-07-31 22:18 ~~碾压机 阅读(182) 评论(0) 推荐(0) 编辑

第二次组队赛之:Can you find it?&&Toxophily&& Party All the Time&& Squares

摘要: Can you find it?HDU2141题目好理解:在输入的三行数据中(必须每行取一个数)相加与输入的值比较。如果用暴力肯定会超时的:那么把俩行合并,再二分。。。 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 int ab[501*501]; 7 int dis(int h,int q)//二分查找 8 { 9 int left,right,mid;10 left=0;11 right=h-1;12 while(leftq)18 right=... 阅读全文
posted @ 2013-07-31 16:20 ~~碾压机 阅读(159) 评论(0) 推荐(0) 编辑