2014年3月14日

foj 2144 三位几何+区间覆盖

摘要: 题目大意:一个人站在三维坐标系下的原点处用炮打蚊子,给出n个蚊子的起始坐标跟单位时间匀速移动的方向向量,距离他R以内的蚊子都可以打到,不过他也需要休息,没蚊子的时候也可以休息下。求他要起来多少次打蚊子。#include #include #include #include using namespace std;const int N = 100005;const double eps = 1e-6;const double Pi=acos(-1.0);int n, cnt;double R;inline bool scan_d(double &ret){ //如果数据比较多,而输入的 阅读全文

posted @ 2014-03-14 19:09 雄.. 阅读(211) 评论(0) 推荐(0)

Foj 2148 二维几何(点是否在三角形内)

摘要: 题目大意:给n个坐标(不存在三点共线的点),求能够组成多少个凸四边形。#include#include#includeusing namespace std;struct Point{ int x,y; Point(int x=0,int y=0):x(x),y(y){}}p[35];typedef Point Vector;Vector operator - (Vector A, Vector B){ return Vector(A.x-B.x,A.y-B.y);}int AbsCross(Vector A,Vector B){ return fabs(A.x*B.y-A.y*B... 阅读全文

posted @ 2014-03-14 19:01 雄.. 阅读(202) 评论(0) 推荐(0)

foj 2150 bfs

摘要: 题意:给定一个平面图 . 为空地(不着火) # 为草开始可以选1-2个草堆点燃,每隔一秒会把上下左右的草引燃(开始时间为0秒)问把所有草烧光的最少时间#include#include#include#includeusing namespace std;const int INF=1000000000;inline int min(int a,int b){return ab?a:b;}char mp[15][15];int v[15][15];int R,C;int dir[4][2]={0,1,0,-1,1,0,-1,0};struct Node{ int x,y; Node(... 阅读全文

posted @ 2014-03-14 18:57 雄.. 阅读(153) 评论(0) 推荐(0)

导航