枚举子序列的末尾,递推。方案数:f[i = 以i结尾][k =子序列长度] = sum(f[j][k-1]),j using namespace std;typedef long long ll;const int N = 1e5+5, K = 10;ll C[K][N];ll sum(ll C[]...
分类:
其他好文 时间:
2015-12-20 13:16:43
阅读次数:
239
两种算法1. O(n^2) 1 #include 2 #include 3 #include 4 using namespace std; 5 6 int a[1005]; 7 int dp[1005]; 8 int main() 9 {10 int n, maxn;11 whil...
分类:
其他好文 时间:
2015-12-20 13:09:32
阅读次数:
194
问题:如果一个整数n至少在两个不同进位制b1,b2下都是回文数(2≤b1,b2≤10)则n是双基回文数,注意回文数中不能包含前导0。输入n,n 2 using namespace std; 3 int main() 4 { 5 int i,j,k,flag,count = 0; 6 ...
分类:
其他好文 时间:
2015-12-20 10:26:35
阅读次数:
228
过程是模板 merge完后扫一下几个跟0同祖先节点就是答案了#include #include #include #include #include #include #include #include #include using namespace std;const int MAX=30005...
分类:
数据库 时间:
2015-12-20 01:54:07
阅读次数:
209
ajaxForm插件最好选择:jquery forms plugin.以下为示例:Ajax.BeginForm @using (Ajax.BeginForm("YourAction", "YourController", new AjaxOptions() { HttpMethod = "POST"...
分类:
Web程序 时间:
2015-12-20 01:50:24
阅读次数:
359
1 /* 2 ========最长公共子序列======== 3 所用算法 动态规划 4 作者 程松 5 时间 2015/12/11 16:43 6 所用语言 c++ 7 */ 8 #include 9 #include10 #include11 using namespace std;12 co....
分类:
其他好文 时间:
2015-12-20 00:40:42
阅读次数:
157
case在编程中偶尔使用到switch case语句,对于case语句的处理,出现了两种错误,现总结如下:1 case后必须是常量,不能使用‘’这种逻辑运算2 case后如果是‘||’或者‘&&’逻辑运算,则实际是1或者0#include using namespace std;int main(i...
分类:
其他好文 时间:
2015-12-19 23:20:55
阅读次数:
363
1 摘自网上2代码实例#include #include #include #include using namespace std;class Term{ public: Term(int c,int e):coef(c),exp(e){ } flo...
分类:
编程语言 时间:
2015-12-19 23:16:32
阅读次数:
229
1 #include 2 using namespace std; 3 4 template 5 class complex 6 { 7 public: 8 T1 real; 9 T2 imag;10 complex();11 complex(T1 r, T2...
分类:
其他好文 时间:
2015-12-19 23:15:14
阅读次数:
191
递归实现:#include using namespace std; typedef struct node { struct node *leftChild; struct node *rightChild; char data; }BiTreeNode, *...
分类:
其他好文 时间:
2015-12-19 23:11:14
阅读次数:
184