2012年3月28日
摘要: http://poj.org/problem?id=3714#include<iostream>#include<cstdio>#include<string.h>#include<algorithm>#include<queue>#include<vector>#include<cmath>using namespace std;const double Max=2000000000.0;struct node{ long x,y; bool k;}mem[200005];int M;bool cmp(nod 阅读全文
posted @ 2012-03-28 19:43 夜-> 阅读(164) 评论(0) 推荐(0) 编辑
  2012年3月27日
摘要: http://poj.org/problem?id=3349#include<iostream>#include<cstdio>#include<string.h>#include<algorithm>#include<queue>#include<vector>#include<math.h>#define N 5000using namespace std;struct node{ int a[6]; int sum;}mem[100005];vector< int >str[5000];inl 阅读全文
posted @ 2012-03-27 20:19 夜-> 阅读(192) 评论(0) 推荐(0) 编辑
  2012年3月26日
摘要: http://poj.org/problem?id=3368RMQ+二分#include<iostream>#include<stdio.h>#include<string.h>#include<algorithm>#include<queue>#include<math.h>using namespace std;int f[100005][21];bool had[100005][21];int a[100005];long b[100005];int n,q,m;int dp(int i,int j){ if(had 阅读全文
posted @ 2012-03-26 21:39 夜-> 阅读(218) 评论(0) 推荐(0) 编辑
  2012年3月24日
摘要: http://poj.org/problem?id=3259#include<iostream>#include<stdio.h>#include<algorithm>#include<math.h>#include<string.h>#define Max 0xfffffffusing namespace std;struct node{ int i,j;}mem[5500];int main(){ //freopen("r","data.txt",stdin); int n,m,w,M; i 阅读全文
posted @ 2012-03-24 20:38 夜-> 阅读(138) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1062#include<iostream>#include<stdio.h>#include<algorithm>#include<math.h>#include<string.h>using namespace std;struct next{ int instead; int j; struct next *next;};struct head{ struct next *next; int need; int L;}mem[101];void build(int i,int 阅读全文
posted @ 2012-03-24 11:43 夜-> 阅读(125) 评论(0) 推荐(0) 编辑
  2012年3月23日
摘要: http://poj.org/problem?id=2253#include<iostream>#include<stdio.h>#include<algorithm>#include<math.h>#include<string.h>using namespace std;struct node{ int x,y;}mem[1005];bool visited[1005];double dis[1005];inline double disoftwopoints(int i,int j){ return sqrt((double(m 阅读全文
posted @ 2012-03-23 19:36 夜-> 阅读(143) 评论(0) 推荐(0) 编辑
  2012年3月22日
摘要: http://poj.org/problem?id=3020#include<iostream>#include<stdio.h>#include<algorithm>#include<string.h>using namespace std;struct node{ int x,y;}pre[50][15];int b[4]={0,1,-1,0};int a[4]={1,0,0,-1};bool had[50][15];bool map[50][15]; //true ´ú±í *bool cover[5 阅读全文
posted @ 2012-03-22 13:11 夜-> 阅读(144) 评论(0) 推荐(0) 编辑
  2012年3月11日
摘要: http://poj.org/problem?id=1273#include<iostream>#include<stdio.h>#include<string.h>#include<queue>#include<math.h>using namespace std;int path[202][202];bool had[202];int f[202];int N,M;int ans;int find(int st,int nd){ //cout<<"ttt\n"; memset(had,false,s 阅读全文
posted @ 2012-03-11 00:58 夜-> 阅读(144) 评论(0) 推荐(0) 编辑
  2012年2月22日
摘要: http://poj.org/problem?id=2524#include<iostream>#include<stdio.h>#include<string.h>#include<string>#include<algorithm>using namespace std;int f[50001];int ans;inline int find(int i){ if(f[i]!=i) { f[i]=find(f[i]); } return f[i];}int main(){ int n,m,i,j; int l=0; while(c 阅读全文
posted @ 2012-02-22 18:55 夜-> 阅读(135) 评论(0) 推荐(0) 编辑
  2012年2月19日
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2159二维DP 并不是很难#include<iostream>#include<stdio.h>#include<algorithm>#include<string.h>#include<string>using namespace std;struct node{ int a,b;}mem[101]; //a表示经验值 b 表示所需忍耐度int n,m,k,s;int ans[101][101];//ans[i][j]表示用i个忍耐度最多杀j个怪所 阅读全文
posted @ 2012-02-19 12:59 夜-> 阅读(179) 评论(0) 推荐(0) 编辑