NWU_ACM

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

03 2017 档案

摘要: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) memset(( 阅读全文
posted @ 2017-03-31 21:13 NWU_ACM 阅读(426) 评论(0) 推荐(0)

摘要:1 #include<bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 ll dp[35] = {1, 1}; 5 int main() 6 { 7 int T; 8 for(int i = 2; i <= 30; i++ 阅读全文
posted @ 2017-03-30 19:13 NWU_ACM 阅读(157) 评论(0) 推荐(0)

摘要: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 const ll p = 100000 阅读全文
posted @ 2017-03-29 17:30 NWU_ACM 阅读(661) 评论(0) 推荐(0)

摘要:// stack #include #include char str[11000]; char stack1[11000]; int main() { int N; scanf("%d",&N); while(N--) { int i,j,top1; memset(str,0,sizeof(str)); me... 阅读全文
posted @ 2017-03-27 21:28 NWU_ACM 阅读(115) 评论(0) 推荐(0)

摘要:#include #include #include #include using namespace std; struct point { int x,id; char na[201]; bool operator que; for (i=1;i<=n;i++) { que.push(p... 阅读全文
posted @ 2017-03-27 13:09 NWU_ACM 阅读(126) 评论(0) 推荐(0)

摘要:1 #include <cstdio> 2 #include <cstring> 3 #include <algorithm> 4 5 using namespace std; 6 7 const int MAXN = 50003; 8 9 int n, k, ans, d, x, y; 10 in 阅读全文
posted @ 2017-03-26 20:49 NWU_ACM 阅读(135) 评论(0) 推荐(0)

摘要:1 #include<stdio.h> 2 long long int a[25][1005],sum[25][1005]; 3 long long int max(long long int x,long long int y) 4 { 5 if(x>y) return x; 6 else ret 阅读全文
posted @ 2017-03-24 19:05 NWU_ACM 阅读(115) 评论(0) 推荐(0)

摘要:1 #include<cstdio> 2 #include<cstring> 3 #include<algorithm> 4 #define mod 100000000 5 using namespace std; 6 int dp[13][1<<12],cur[13]; 7 int can[1<< 阅读全文
posted @ 2017-03-23 18:03 NWU_ACM 阅读(91) 评论(0) 推荐(0)

摘要:打表代码: 提交代码: 阅读全文
posted @ 2017-03-21 19:21 NWU_ACM 阅读(159) 评论(0) 推荐(0)

摘要:1 #include <iostream> 2 #include <algorithm> 3 #include <cstring> 4 #include <cstdio> 5 #include <bitset> 6 #include <vector> 7 #include <queue> 8 #in 阅读全文
posted @ 2017-03-21 16:52 NWU_ACM 阅读(187) 评论(0) 推荐(0)

摘要:1 #include <iostream> 2 using namespace std; 3 long long fastm(long long a, long long b, long long p) 4 { 5 long long ans = 1; 6 a = a%p; 7 while(b) 8 阅读全文
posted @ 2017-03-20 17:06 NWU_ACM 阅读(123) 评论(0) 推荐(0)

摘要:1 #include <iostream> 2 using namespace std; 3 int main() 4 { 5 int T, n, i; 6 cin >> T; 7 int x[100]; 8 while (T--) 9 { 10 cin >> n; 11 for (i = 1; i 阅读全文
posted @ 2017-03-18 20:51 NWU_ACM 阅读(145) 评论(0) 推荐(0)

摘要:#include #include int dp[1005][1005]; char str1[1005],str2[1005]; int min(int a,int b,int c){ int min=a; if(min>b) min=b; if(min>c) min=c; return min; } int main() { int n,m; ... 阅读全文
posted @ 2017-03-18 16:05 NWU_ACM 阅读(158) 评论(0) 推荐(0)

摘要:1 #include<iostream> 2 #include<algorithm> 3 #include<math.h> 4 #include<string.h> 5 #include<map> 6 #include<set> 7 #include<stdio.h> 8 #include<stdl 阅读全文
posted @ 2017-03-17 21:05 NWU_ACM 阅读(117) 评论(0) 推荐(0)

摘要:1 #include<stdio.h> 2 int sum[100005][15]={0},map[100005][15]={0};//map[t][x]记录在t秒时第x个位置有几个馅饼落下 3 int max(int a,int b,int c) 4 { 5 if(a<b) a=b; 6 if(a 阅读全文
posted @ 2017-03-16 18:34 NWU_ACM 阅读(139) 评论(0) 推荐(0)

摘要:1 #include <iostream> 2 using namespace std; 3 int a[1001]; 4 int main() { 5 int n; 6 while(cin>>n) 7 cout<<(n*n*n+5*n)/6+1<<endl; 8 } 阅读全文
posted @ 2017-03-13 20:19 NWU_ACM 阅读(108) 评论(0) 推荐(0)

摘要:1 #include<stack> 2 #include<queue> 3 #include<cmath> 4 #include<vector> 5 #include<cstdio> 6 #include<cstring> 7 #include<iostream> 8 #include<algori 阅读全文
posted @ 2017-03-13 20:04 NWU_ACM 阅读(169) 评论(0) 推荐(0)

摘要:1 #include <iostream> 2 #include <algorithm> 3 #include <cstring> 4 #include <cstdio> 5 #include <bitset> 6 #include <vector> 7 #include <queue> 8 #in 阅读全文
posted @ 2017-03-13 16:02 NWU_ACM 阅读(158) 评论(0) 推荐(0)

摘要:Badboy学长: 1 #include<iostream> 2 #include<algorithm> 3 #include<cmath> 4 #include<cstring> 5 #include<string> 6 #include<map> 7 #include<cstdio> 8 usi 阅读全文
posted @ 2017-03-12 19:48 NWU_ACM 阅读(173) 评论(0) 推荐(0)

摘要:1 #include<stdio.h> 2 int a[1000005], d[1000005], l, r, n, k; 3 int main() 4 { 5 while(scanf("%d%d", &n, &k) != EOF) 6 { 7 for(int i = 1; i <= n; i++) 阅读全文
posted @ 2017-03-11 16:33 NWU_ACM 阅读(131) 评论(0) 推荐(0)

摘要:#include using namespace std; #define N 1010 queue q1,q2; bool flag=1; int main() { int n,k1,k2; int a1[N],a2[N]; cin>>n; cin>>k1; int ans=0; for(int i=0;i>a1[i]; q1.p... 阅读全文
posted @ 2017-03-10 21:07 NWU_ACM 阅读(164) 评论(0) 推荐(0)

摘要: 阅读全文
posted @ 2017-03-08 20:58 NWU_ACM 阅读(253) 评论(0) 推荐(0)

摘要:1 #include <iostream> 2 #include <algorithm> 3 #include <cstdio> 4 using namespace std; 5 int fun(int x[], int N) 6 { 7 int t = 0; 8 if (N == 1) t = x 阅读全文
posted @ 2017-03-07 20:39 NWU_ACM 阅读(150) 评论(0) 推荐(0)

摘要:1 #include<iostream> 2 #include<algorithm> 3 #include<string.h> 4 #include<math.h> 5 #define ll long long 6 #define IO ios_base::sync_with_stdio(0);ci 阅读全文
posted @ 2017-03-07 20:03 NWU_ACM 阅读(102) 评论(0) 推荐(0)

摘要:#include #include using namespace std; int main() { int x,y,w,n; while(scanf("%d%d%d%d",&x,&y,&w,&n)!=-1) { if(n==1) { puts("0"); continue; ... 阅读全文
posted @ 2017-03-07 13:07 NWU_ACM 阅读(119) 评论(0) 推荐(0)

摘要:1 #include<stdio.h> 2 int num[11]={0}; 3 int main() 4 { 5 long long int n,b; 6 int i,j,k,l,ans; 7 scanf("%lld",&n); 8 scanf("%d",&k); 9 b=n; 10 j=1; 1 阅读全文
posted @ 2017-03-06 19:23 NWU_ACM 阅读(144) 评论(0) 推荐(0)

摘要:解题思路: 如果从i,j可以顺着某侧滑的话: 1 dp[i][j] = max{dp[i-1][j],dp[i][j-1],dp[i+1][j],dp[i][j+1]} + 1 那么我们可以写出以下递归: 1 int dp(int i,int j) 2 { 3 for(i,j上侧,下侧,左侧,右侧) 阅读全文
posted @ 2017-03-05 19:19 NWU_ACM 阅读(208) 评论(0) 推荐(0)

摘要:#include #include #include #include #include #include using namespace std; int ucol[1005],dcol[1005],lrow[1005],rrow[1005]; int numr[1005],numc[1005]; int a[1005][1005]; int main(){ int n,m; whil... 阅读全文
posted @ 2017-03-03 22:03 NWU_ACM 阅读(202) 评论(0) 推荐(0)

摘要:1 #include <iostream> 2 #include <algorithm> 3 #include <cstring> 4 #include <cstdio> 5 #include <bitset> 6 #include <vector> 7 #include <queue> 8 #in 阅读全文
posted @ 2017-03-03 19:03 NWU_ACM 阅读(166) 评论(0) 推荐(0)

摘要:1 #include <stdio.h> 2 #include <string.h> 3 #include <algorithm> 4 using namespace std; 5 6 inline int id(int u, int v) { return (u + v) | (u < v); } 阅读全文
posted @ 2017-03-02 17:58 NWU_ACM 阅读(117) 评论(0) 推荐(0)

摘要:1 #include <iostream> 2 #include <cstdio> 3 #include <stack> 4 using namespace std; 5 stack<int> s; 6 int main() 7 { 8 int fsize, fdir, n; 9 // freope 阅读全文
posted @ 2017-03-01 18:30 NWU_ACM 阅读(107) 评论(0) 推荐(0)