雕刻时光

just do it……nothing impossible
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2011年3月16日

摘要: set统计太方便了View Code #include<iostream>#include<set>using namespace std;struct data{ int x,y;}a[209];int main(){ int n; set<double>set1; while(scanf("%d",&n)!=EOF) { set1.clear(); int i,j; for(i=1;i<=n;i++) { scanf("%d%d",&a[i].x,&a[i].y); } double 阅读全文

posted @ 2011-03-16 20:42 huhuuu 阅读(225) 评论(0) 推荐(0) 编辑

摘要: 用贪心做初始i=j=1当i/j>=n/m时:j++反之i++随时记录最接近的值即可View Code #include<stdio.h>double jue(double a){ if(a>0)return a; return -a;}int main(){ int n,m; while(scanf("%d %d",&n,&m)!=EOF) { int ri,rj,i,j; double e=n*1.0/m,t,cha=99999999; i=1; j=1; while(i<=32767&&j<=32767 阅读全文

posted @ 2011-03-16 20:11 huhuuu 阅读(157) 评论(0) 推荐(0) 编辑

摘要: bfs搜索,两次分别从两个出口搜,开数组ste[i][j]时刻记录(更新)点i,j到出口的最短距离最后在ste[i][j]查找最大值……View Code #include<stdio.h>#include<iostream>#include<queue>using namespace std;int map[209][80];int hash[209][80];int ste[209][80];int Max;int p[4][2]={0,-1,-1,0,0,1,1,0};int w,h;struct data{ int tei; int tej; int 阅读全文

posted @ 2011-03-16 15:53 huhuuu 阅读(212) 评论(0) 推荐(0) 编辑