1 2 3 4 5 ··· 21 下一页
摘要: 1000.a+b。 #include<bits/stdc++.h> using namespace std; int a,b; int main() { ios::sync_with_stdio(false); while(~scanf("%d%d",&a,&b)) printf("%d\n",a+ 阅读全文
posted @ 2017-08-31 23:52 zzzzzzzzhu 阅读(4059) 评论(0) 推荐(2) 编辑
摘要: A.简单dp。 #include<bits/stdc++.h> using namespace std; int n,a[105],dp[105][2] = {0}; int main() { ios::sync_with_stdio(0); cin >> n; for(int i = 1;i <= 阅读全文
posted @ 2017-09-06 19:33 zzzzzzzzhu 阅读(351) 评论(0) 推荐(0) 编辑
摘要: A.分三种情况。 #include<bits/stdc++.h> using namespace std; int n,k,t; int main() { ios::sync_with_stdio(0); cin >> n >> k >> t; if(t <= k) cout << t << end 阅读全文
posted @ 2017-09-05 20:53 zzzzzzzzhu 阅读(224) 评论(0) 推荐(0) 编辑
摘要: 排列组合 圆排列 有限多重集的排列 n!/(n1!*n2!*...*nk!) n元无限集可重-r组合C(n+r-1,r)种。 n元无限集取r个,n中每个至少出现一次C(r-1,n-1)(r≥n) 直线分平面: f(1) = 2 f(n) = f(n-1)+n = n(n+1)/2+1 折线分平面: 阅读全文
posted @ 2017-09-03 01:57 zzzzzzzzhu 阅读(465) 评论(0) 推荐(0) 编辑
摘要: #include<iomanip> 设置字符填充,c可以是字符常或字符变量 终止已经设置的输出格式状态,在括号中应指定内容 #include<cstring> @strcpy : 函数原型: char* strcpy(char* str1,char* str2); 函数功能: 把str2指向的字符串 阅读全文
posted @ 2017-09-03 01:57 zzzzzzzzhu 阅读(242) 评论(0) 推荐(0) 编辑
摘要: void init() { for(int i = 1;i <= n;i++) pre[i] = i; } int findd(int x) 递归 { return pre[x] == x?x:pre[x] = findd(pre[x]); } void join(int a,int b) { in 阅读全文
posted @ 2017-09-02 22:38 zzzzzzzzhu 阅读(334) 评论(0) 推荐(0) 编辑
摘要: //普通 void getnext1(char *s) { int i = 0,j = -1,len = strlen(s); ne[0] = -1; while(i < len) { if(j == -1 || s[i] == s[j]) ne[++i] = ++j; else j = ne[j] 阅读全文
posted @ 2017-09-02 22:38 zzzzzzzzhu 阅读(213) 评论(0) 推荐(0) 编辑
摘要: 最短路: //权值非负,不连通为INF、 //O(n^2) void dij(int beg) { memset(dis,0x3f,sizeof(dis)); memset(vis,0,sizeof(vis)); dis[beg] = 0; for(int i = 1;i <= n;i++) { i 阅读全文
posted @ 2017-09-02 22:38 zzzzzzzzhu 阅读(319) 评论(0) 推荐(0) 编辑
摘要: int dp[1005][1005] = {0},len1,len2; char a[1005],b[1005]; void lcs() { for(int i = 1; i <= len1;i++) { for(int j = 1;j <= len2;j++) { if(a[i-1] == b[j 阅读全文
posted @ 2017-09-02 22:37 zzzzzzzzhu 阅读(244) 评论(0) 推荐(0) 编辑
摘要: int cnt,prime[MAXN+1],mi[MAXN+1],vis[MAXN+1]; //cnt表示素数个数 //prime存放每个素数 //mi存放每个数的最小素数因子 void getprime() { cnt = 0; memset(prime,0,sizeof(prime)); for 阅读全文
posted @ 2017-09-02 22:37 zzzzzzzzhu 阅读(277) 评论(0) 推荐(0) 编辑
摘要: #pragma comment(linker, "/STACK:102400000,102400000") #include<cstdio> #include<iostream> #include<iomanip> #include<algorithm> #include<cmath> #inclu 阅读全文
posted @ 2017-09-02 01:56 zzzzzzzzhu 阅读(387) 评论(0) 推荐(0) 编辑
1 2 3 4 5 ··· 21 下一页