摘要: 组合游戏题;组合游戏的规则:1.必败态的所有后继都是必胜态;2.必胜态最少有一个必败的后继;这里的必胜态是f[1][0][0][0];其中f[a][b][c][d]表示有a个1,b个2,c个3,d个4是不是一个必胜态;可以认为大于3的奇数等同于3,大于4的偶数等同于4.然后递归求解; 1 #include 2 using namespace std; 3 4 bool vis[51][51][51][51]; 5 bool f[51][51][51][51]; 6 int F(int a,int b,int c,int d) 7 { 8 if (!vis[a][b][c][d]) ... 阅读全文
posted @ 2013-11-04 21:08 Yours1103 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 旋转卡壳算法;直接在这个上面粘的模板主要用途:用于求凸包的直径、宽度,两个不相交凸包间的最大距离和最小距离···这题就是求凸包的直径 1 #include 2 #include 3 #include 4 #include 5 #include 6 #define eps 1e-9 7 using namespace std; 8 const double pi = acos(-1); 9 10 int dcmp(double x) 11 { 12 return fabs(x) 0 ? 1 : -1); 13 } 14 15 struct Point 1... 阅读全文
posted @ 2013-11-04 20:17 Yours1103 阅读(216) 评论(0) 推荐(0) 编辑
摘要: 当退化成点和线段的时候,可以不进行特判;因为这种情况已经包括进条件1.2里面了 1 #include 2 #include 3 #include 4 #include 5 #include 6 #define eps 1e-9 7 using namespace std; 8 const double pi = acos(-1); 9 10 int dcmp(double x) 11 { 12 return fabs(x) 0 ? 1 : -1); 13 } 14 15 struct Point 16 { 17 double x; 18 ... 阅读全文
posted @ 2013-11-04 19:50 Yours1103 阅读(203) 评论(0) 推荐(0) 编辑
摘要: 凸包+一点直线的知识; 1 #include 2 #include 3 #include 4 #include 5 #include 6 #define eps 1e-9 7 using namespace std; 8 const double pi = acos(-1); 9 10 int dcmp(double x) 11 { 12 return fabs(x) 0 ? 1 : -1); 13 } 14 15 struct Point 16 { 17 double x; 18 double y; 19 20 Point(... 阅读全文
posted @ 2013-11-04 16:24 Yours1103 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 主要是凸包的应用; 1 #include 2 #include 3 #include 4 #include 5 #include 6 #define eps 1e-9 7 using namespace std; 8 const double pi = acos(-1); 9 10 int dcmp(double x) 11 { 12 return fabs(x) 0 ? 1 : -1); 13 } 14 15 struct Point 16 { 17 double x; 18 double y; 19 20 Point(do... 阅读全文
posted @ 2013-11-04 15:34 Yours1103 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 这个题目的方法是将圆盘分成一个个圆环,然后判断这些圆环是否被上面的圆覆盖;如果这个圆的圆周上的圆弧都被上面的覆盖,暂时把它标记为不可见;然后如果他的头上有个圆,他有个圆弧可见,那么他自己本身可见,并且可以把这条圆弧下面的第一个圆重新标记为可见;另外,圆弧可见还是不可见利用它的中点来进行判断; 1 #include 2 #include 3 #include 4 #include 5 #include 6 7 using namespace std; 8 9 const int maxn = 100 + 10; 10 const double eps = 1e-1... 阅读全文
posted @ 2013-11-04 15:04 Yours1103 阅读(272) 评论(0) 推荐(0) 编辑