- 博客(53)
- 收藏
- 关注
转载 DP/POJ 1837 Balance
1 #include<cstdio> 2 #include<cstring> 3 using namespace std; 4 int f[25][15010]; 5 int c[25],g[25]; 6 int C,G; 7 int main() 8 { 9 scanf("%d%d",&C,&G);...
2014-12-19 23:35:00
123
转载 贪心/POJ 3069 Saruman's Army
1 #include<cstdio> 2 #include<cstring> 3 #include<algorithm> 4 using namespace std; 5 int n,r,ans; 6 int a[1010]; 7 int cmax(int x,int y){return x>y?x:y;} 8 ...
2014-12-19 23:34:00
97
转载 贪心/POJ 3617 Best Cow Line
1 #include<cstdio> 2 #include<cstring> 3 using namespace std; 4 int main() 5 { 6 int n; 7 char s1[2020],s2[2020]; 8 scanf("%d",&n); 9 for (int i...
2014-12-19 23:32:00
103
转载 哈夫曼树/贪心/POJ 3253 Fence Repair
1 #include<cstdio> 2 #include<cstring> 3 #include<algorithm> 4 #include<iostream> 5 using namespace std; 6 int n; 7 int a[20010]; 8 bool cmp(int x,int y)...
2014-12-19 23:31:00
115
转载 贪心/CodeForces 489C Given Length and Sum of Digits...
1 #include<cstdio> 2 using namespace std; 3 int m,s; 4 int main() 5 { 6 scanf("%d%d",&m,&s); 7 if (s==0 && m==1) printf("0 0\n"); 8 else if (s==...
2014-12-15 10:08:00
103
转载 贪心/CodeForces 461A Appleman and Toastman
1 #include<cstdio> 2 #include<algorithm> 3 using namespace std; 4 long long a[300010]; 5 long long n; 6 int main() 7 { 8 scanf("%lld",&n); 9 for (long ...
2014-12-15 10:06:00
118
转载 DFS/poj 1011/hdu 1455 Sticks
1 #include<cstdio> 2 #include<algorithm> 3 #include<cstring> 4 using namespace std; 5 int n,tot,ans; 6 bool v[100]; 7 int a[100]; 8 bool cmp(int x,int y) 9 {...
2014-12-15 10:05:00
111
转载 贪心/poj 1042 Gone Fishing
1 #include<cstdio> 2 #include<cstring> 3 using namespace std; 4 struct node 5 { 6 int d; 7 int fish; 8 int ans; 9 };10 node a[30],b[30];11 int t[30]...
2014-12-11 22:46:00
178
转载 贪心/poj 1018 Communication System
1 #include<cstdio> 2 #include<cstring> 3 #include<algorithm> 4 using namespace std; 5 const int INF=0xfffffff; 6 struct node 7 { 8 int b,p; 9 };10 node ...
2014-12-11 22:45:00
98
转载 贪心/poj 2437 Muddy roads
1 #include<cstdio> 2 #include<cstring> 3 #include<algorithm> 4 using namespace std; 5 struct node 6 { 7 int st,ed; 8 }; 9 node a[10010];10 11 int n,L,...
2014-12-11 22:43:00
111
转载 贪心/poj 1328 Radar Installation
1 #include<cstdio> 2 #include<cstring> 3 #include<cmath> 4 #include<algorithm> 5 using namespace std; 6 struct node 7 { 8 double right,left; 9 };1...
2014-12-11 22:41:00
114
转载 贪心/poj 1456 Supermarket
1 #include<cstdio> 2 #include<cstring> 3 #include<algorithm> 4 using namespace std; 5 struct node 6 { 7 int value; 8 int ddl; 9 };10 node a[10010];...
2014-12-11 22:39:00
96
转载 贪心/hdu 2037 今年暑假不AC
1 #include<cstdio> 2 #include<algorithm> 3 #include<cstring> 4 using namespace std; 5 struct node 6 { 7 int st; 8 int ed; 9 };10 node a[110];11 in...
2014-12-11 22:38:00
78
转载 贪心/hdu 1789 Doing Homework again
1 #include<cstdio> 2 #include<algorithm> 3 #include<cstring> 4 using namespace std; 5 int n,ans; 6 struct node 7 { 8 int score; 9 int ddl;10 };11 ...
2014-12-11 22:36:00
130
转载 贪心/poj 1922 Ride to School
1 #include<cstdio> 2 #include<cmath> 3 using namespace std; 4 int n,ans,v,t; 5 int main() 6 { 7 scanf("%d",&n); 8 while (n!=0) 9 {10 ans=0...
2014-12-11 22:34:00
138
转载 贪心/poj 1323 Game Prediction
1 #include<cstdio> 2 #include<algorithm> 3 #include<cstring> 4 using namespace std; 5 int m,n,lose,x; 6 bool flag[1010],v[1010]; 7 bool cmp(int a,int b) 8 { 9...
2014-12-11 22:32:00
130
转载 贪心/hdu 1052 Tian Ji -- The Horse Racing
1 #include<cstdio> 2 #include<cstring> 3 #include<algorithm> 4 using namespace std; 5 int n; 6 int tian[1010],king[1010]; 7 bool cmp(int x,int y) 8 { 9 re...
2014-12-11 22:29:00
88
转载 贪心/hdu 1051 Wooden Sticks
#include<cstdio>#include<algorithm>#include<cstring>using namespace std;struct node{ int l,w; bool v;};int n;node a[5010];bool cmp(node x,node y)...
2014-12-11 22:28:00
69
转载 贪心/poj 2231 Moo Volume
#include<cstdio>#include<cstring>#include<algorithm>using namespace std;long long a[10010];int main(){ int n; scanf("%d",&n); for (int i=1;i<...
2014-12-11 22:25:00
102
转载 贪心/poj 1017 Packets
1 #include<cstdio> 2 #include<cstring> 3 using namespace std; 4 5 int main() 6 { 7 int a1,a2,a3,a4,a5,a6; 8 scanf("%d%d%d%d%d%d",&a1,&a2,&a3,&...
2014-12-11 22:17:00
109
转载 贪心/Hdu 1050 Moving Tables
#include<cstdio>#include<cstring>using namespace std;int a[220];int cmax(int a,int b){return a>b?a:b;}int main(){ int T; scanf("%d",&T); for (int t...
2014-12-11 22:12:00
66
转载 贪心/CoderForces 228c Fox and Box Accumulation
1 #include<cstdio> 2 #include<cstring> 3 #include<algorithm> 4 using namespace std; 5 int a[110]; 6 int main() 7 { 8 int n; 9 scanf("%d",&n);10 ...
2014-12-11 22:10:00
117
转载 DFS/POJ 2676 Sudoku
1 #include<cstdio> 2 #include<cstring> 3 using namespace std; 4 bool v[10][10],row[10][10],col[10][10],used[4][4][10]; 5 int a[10][10]; 6 bool flag; 7 void dfs(int x,in...
2014-12-07 23:24:00
71
转载 DFS/POJ 2531 Network Saboteur
1 #include<cstdio> 2 #include<cstring> 3 using namespace std; 4 int n,ans; 5 int a[30][30],f[30]; 6 int cmax(int a,int b){return a>b?a:b;} 7 void dfs(int x,int now)...
2014-12-07 23:23:00
110
转载 DFS/POJ 1416 Shredding Company
1 #include<cstdio> 2 #include<cstring> 3 using namespace std; 4 int mmax,sum; 5 char s[10]; 6 bool v[10],way[10]; 7 bool rejected; 8 void dfs(int dep,int value,int be...
2014-12-07 23:21:00
95
转载 DFS/四色定理/poj 1129 Channel Allocation
1 #include<cstdio> 2 #include<cstring> 3 using namespace std; 4 int n; 5 int a[30][30]; 6 int c[30]; 7 8 bool pd(int x,int color) 9 {10 for (int i=1;i<x;i...
2014-12-07 23:19:00
101
转载 BFS/poj 3414 pots
#include<cstdio>#include<queue>#include<cstring>using namespace std;struct point{ int a,b; int step; int way[110];};int aa,bb,cc;int v[110][110]...
2014-12-07 23:16:00
68
转载 模拟/poj 3087 Shuffle'm Up
1 #include<cstdio> 2 #include<cstring> 3 using namespace std; 4 char s1[110],s2[110],ss[220]; 5 int len,n; 6 7 int f() 8 { 9 int ans=0;10 char t1[110],t2...
2014-12-05 22:41:00
101
转载 BFS/poj 3126 prime path
1 #include<cstdio> 2 #include<queue> 3 #include<cstring> 4 #include<cmath> 5 using namespace std; 6 int n,x,y; 7 bool v[20000]; 8 struct point 9 {10 ...
2014-12-05 21:43:00
72
转载 BFS/poj 1426 Find The Multiple
1 #include<cstdio> 2 #include<cstring> 3 #include<queue> 4 using namespace std; 5 int n; 6 bool v[210]; 7 unsigned long long bfs(int n) 8 { 9 memset(v,0,s...
2014-12-04 09:18:00
78
转载 BFS/poj 3278 Catch That Cow
1 #include<cstdio> 2 #include<queue> 3 #include<cstring> 4 using namespace std; 5 const int MAXN=200010; 6 int n,k; 7 bool v[MAXN]; 8 struct point 9 {10 ...
2014-12-04 08:39:00
104
转载 BFS/poj 2251 Dungeon Master
1 #include<cstdio> 2 #include<queue> 3 #include<cstring> 4 using namespace std; 5 6 const int dx[6]={1,0,-1,0,0,0}; 7 const int dy[6]={0,1,0,-1,0,0}; 8 const i...
2014-12-03 14:02:00
76
转载 dfs/poj 2488 A Knight's Journey
1 #include<cstdio> 2 using namespace std; 3 const int b[8][2]={{-2,-1},{-2,1},{-1,-2},{-1,2},{1,-2},{1,2},{2,-1},{2,1}}; 4 int a[30][30],p,q; 5 struct 6 { 7 int x,y; 8 ...
2014-12-02 22:45:00
64
转载 dfs/poj 3009 Curling 2.0
1 #include<cstdio> 2 using namespace std; 3 4 const int dx[4]={0,1,0,-1}; 5 const int dy[4]={1,0,-1,0}; 6 7 int m,n,ans,ex,ey,sx,sy; 8 int a[22][22]; 9 10 int cmin(in...
2014-12-02 22:43:00
65
转载 dfs/poj3083 Children of the Candy Corn
1 #include<cstdio> 2 #include<cstring> 3 #include<queue> 4 5 using namespace std; 6 typedef pair<int,int>P; 7 const int dx[4]={1,0,-1,0}; 8 const...
2014-12-02 22:41:00
80
转载 dfs/poj 2386 Lake Counting
1 #include<cstdio> 2 using namespace std; 3 const int b[8][2]={{-1,-1},{-1,0},{-1,1},{1,-1},{1,0},{1,1},{0,-1},{0,1}}; 4 int n,m; 5 char a[110][110]; 6 7 void dfs(int x,int ...
2014-11-15 19:12:00
102
转载 水题/poj 1852 Ants
1 /* 2 PROBLEM:poj1852 3 AUTHER:Nicole 4 MEMO:水题 5 */ 6 #include<cstdio> 7 using namespace std; 8 int cmax(int a,int b){return a>b?a:b;} 9 int cmin(int a,i...
2014-11-11 08:51:00
68
转载 数学/Codeforces 483b Friends and Presents
1 #include<cstdio> 2 using namespace std; 3 long long m,cnt1,cnt2,x,y; 4 long long gcd(long long a,long long b) 5 { 6 if (b==0) return a; 7 return gcd(b,a % b); 8 }...
2014-11-09 11:06:00
95
转载 数学/CodeForces 483a Counterexample
1 /* 2 PROBLEM:CF 483A 3 AUTHER:Nicole 4 MEMO:数学 5 */ 6 #include<cstdio> 7 using namespace std; 8 int main() 9 {10 long long l,r;11 scanf("%lld%ll...
2014-11-09 11:04:00
142
转载 位运算/CodeForces 485c Bits
1 /* 2 PROBLEM:CF 485C 3 AUTHER:Nicole 4 MEMO:位运算 二进制 5 */ 6 #include<cstdio> 7 int main() 8 { 9 int n;10 scanf("%d",&n);11 for (int i=1;i...
2014-11-09 11:02:00
167
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人