Qiuqiqiu  
不管道路多么崎岖坎坷,我永远不停下追逐梦想的脚步!

2011年12月16日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1372骑士环游 BFS我的代码 1 #include <cstdio> 2 #include <cstring> 3 #include <queue> 4 using namespace std; 5 const int dx[8]={-1,1,2,2,1,-1,-2,-2}; 6 const int dy[8]={2,2,1,-1,-2,-2,-1,1}; 7 int dis[10][10],vis[10][10]; 8 queue<int> q; 9 int 阅读全文
posted @ 2011-12-16 19:45 Qiuqiqiu 阅读(168) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=3400嵌套三分 Orz我的代码 1 #include <stdio.h> 2 #include <math.h> 3 const double eps=1e-6; 4 struct point 5 { 6 double x,y; 7 }a,b,c,d; 8 double v1,v2,v3; 9 double dist(point a,point b)10 {11 return sqrt((b.x-a.x)*(b.x-a.x)+(b.y-a.y)*(b.y-a.y));12 }13 do 阅读全文
posted @ 2011-12-16 17:21 Qiuqiqiu 阅读(186) 评论(0) 推荐(0) 编辑
 
摘要: 三分我的代码 1 #include <stdio.h> 2 #include <math.h> 3 const double pi=acos(-1.0),eps=1e-6; 4 double x,y,l,d; 5 double f(double a) 6 { 7 return (l-(y-d*cos(a))/sin(a))*cos(a)+d*sin(a); 8 } 9 double tsearch(double l,double r)10 {11 double m1,m2;12 while (r-l>eps)13 {14 m1=l+(r-l)/3... 阅读全文
posted @ 2011-12-16 16:08 Qiuqiqiu 阅读(280) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2102BFS我的代码 1 #include <cstdio> 2 #include <queue> 3 using namespace std; 4 const int dx[4]={0,1,0,-1}; 5 const int dy[4]={1,0,-1,0}; 6 char maze[2][15][15]; 7 bool vis[2][15][15]; 8 int n,m,t,dis[2][15][15]; 9 queue<int> q;10 int bfs(int x 阅读全文
posted @ 2011-12-16 11:49 Qiuqiqiu 阅读(154) 评论(0) 推荐(0) 编辑