摘要:#include using namespace std; int D, N; int main() { while (scanf("%d%d", &D, &N)!=EOF) { int k = 1; for (int i = 0; i < D - 1; i++) { if (N % 2) { ...
阅读全文
04 2017 档案
摘要:#include using namespace std; int D, N; int main() { while (scanf("%d%d", &D, &N)!=EOF) { int k = 1; for (int i = 0; i < D - 1; i++) { if (N % 2) { ...
阅读全文
摘要:#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define FF(i, a, b) for(int i=a; i=b; i--) #define REP(i, n) for...
阅读全文
摘要:1 #include<bits/stdc++.h> 2 using namespace std; 3 4 int rec[60]; 5 6 int main() 7 { 8 int a, b, n; 9 rec[0] = rec[1] = rec[2] = 1; 10 while( scanf( "
阅读全文
摘要:1 #include<cstdio> 2 #include<cstring> 3 #include<algorithm> 4 using namespace std; 5 6 //01背包二维正写写法 7 int p[107],w[107],dp[107][1007]; 8 int main() 9
阅读全文
摘要:RMQ: 1 #include <bits/stdc++.h> 2 #define rep(i,a,b) for(int i = a;i <= b;++ i) 3 #define per(i,a,b) for(int i = a;i >= b;-- i) 4 #define mem(a,b) mem
阅读全文
摘要:1 #include <bits/stdc++.h> 2 #define _xx ios_base::sync_with_sdtio(0);cin.tie(0); 3 #define INFS 0x3fffffff 4 #define INFB 0x3fffffffffffffff 5 #defin
阅读全文
摘要:#include #include #include #include #include #include #include using namespace std; int extend_gcd(int a, int b, int &x, int &y) { if (b == 0) { x = 1, y = 0; return a; ...
阅读全文
摘要:#define _CRT_SECURE_NO_WARNINGS #include #include #include #include #include #include #include #include #include #include #include #define LL long long #define lp(s,i,n) for(int i = s;i >a) { ...
阅读全文
摘要:1 //#include <bits/stdc++.h> 2 #include<iostream> 3 #include<stdio.h> 4 #include<string.h> 5 using namespace std; 6 char s[128]; 7 int dp[128][128]; 8
阅读全文
摘要:#include int main() { int n=0,m=0,i=0,j=0,k=0,l=0,x[205][205]={0},a=0,b=0,c=0,s=0,t=0,d[205]={0}; while(scanf("%d%d",&n,&m)!=EOF) { for(i=0;ic)) { x[a]...
阅读全文
摘要:1 #include <bits/stdc++.h> 2 using namespace std; 3 #define rep(i,a,b) for(int i = a;i <= b;++ i) 4 #define per(i,a,b) for(int i = a;i >= b;-- i) 5 #d
阅读全文
摘要:1 #include <iostream> 2 #include <cstdio> 3 #include<queue> 4 #include<cstring> 5 #include <algorithm> 6 using namespace std; 7 int G[501][501]; 8 boo
阅读全文
摘要:1 #include <bits/stdc++.h> 2 #define _xx ios_base::sync_with_stdio(0);cin.tie(0); 3 using namespace std; 4 typedef long long ll; 5 struct node 6 { 7 i
阅读全文
摘要:#include using namespace std; int main() { double n; while (cin >> n) { while (n > 18) n /= 18; if (n <= 9) cout << "Stan wins." << endl; else cout << "Ollie wins." << endl...
阅读全文
摘要:#include #include int main() { __int64 a[21][21]; int i,j,m,n; memset(a,0,sizeof(a));//首先全部初始化为0 for(i=0;i<=20;i++) a[i][0]=1;//当n为0的时候无论吗取何值都是1 for(i=1;i<=20;i++) ...
阅读全文
摘要:1 #include<cstdio> 2 #include<cstring> 3 #include<algorithm> 4 using namespace std; 5 const int maxn=1000+10; 6 const int maxm=1000+10; 7 8 struct Edg
阅读全文
摘要:1 #include<stack> 2 #include<queue> 3 #include<cmath> 4 #include<vector> 5 #include<cstdio> 6 #include<cstring> 7 #include<windows.h> 8 #include<iostr
阅读全文
摘要:1 #include <iostream> 2 #include <algorithm> 3 #include <cstring> 4 #include <cstdio> 5 #include <bitset> 6 #include <vector> 7 #include <queue> 8 #in
阅读全文
摘要:1 #include <iostream> 2 #include <cstring> 3 #include <algorithm> 4 #include <cmath> 5 #include <cstdio> 6 #define _xx ios_base::sync_with_stdio(0);ci
阅读全文
摘要:1 #include <bits/stdc++.h> 2 using namespace std; 3 int main() 4 { 5 int M, N; 6 while (cin >> M >> N) { 7 if (M <= N) { 8 for (int i = M ; i <= N; i+
阅读全文
摘要:1 #include <bits/stdc++.h> 2 #define _xx ios_base::sync_with_stdio(0);cin.tie(0); 3 using namespace std; 4 typedef long long ll; 5 int main() 6 { 7 in
阅读全文
摘要:#include using namespace std; const int maxn=500011; const int inf=1 #define pb push_back #define cl(a,b) memset(a,b,sizeof(a)); int a[maxn]; int main(){ int n; while(~scanf("%d",&n)){ ...
阅读全文
摘要:1 #include <bits/stdc++.h> 2 #define _xx ios_base::sync_with_stdio(0);cin.tie(0); 3 using namespace std; 4 typedef long long ll; 5 ll dp[505][505] = {
阅读全文
摘要:1 #include<stdio.h> 2 int map[100005],aggregate[100005]; 3 int father(int x) 4 { 5 while(x!=aggregate[x]) 6 { 7 x=father(aggregate[x]); 8 } 9 return x
阅读全文
摘要:1 //回文判断 Codeforces Round #286 (Div. 2) 2 #include<iostream> 3 #include<cstdio> 4 int main() 5 { 6 string f,temp; cin>>f; 7 int len(f.size()); 8 for(c
阅读全文
|