2012年1月25日

USACO 5.1 Starry Night

摘要: 这个题我直接模拟的,具体做法是:找到每种图案所在的最小矩形块,把占得长和宽记录一下。然后以最小矩形块的左下角为原点,将团中的坐标重构并排序存储。然后不同图案直接对比,然后标号就行了。注意对比的时候需要考虑4种旋转,还有反转。总共8种情况。。。又写了160来行,160行已然无压力了。。。样例过了一般就过了吧。。。贴下挫代码:/*ID: zlqest11LANG: C++TASK: starry*/#include <iostream>#include <cstdio>#include <cstring>#include <vector>#inclu 阅读全文

posted @ 2012-01-25 22:07 Moon_1st 阅读(374) 评论(0) 推荐(0) 编辑

USACO 5.1 fencing the cows——计算几何/凸包模板

摘要: 终于进入第五章了,第四节最后一个题好无聊= =。此题纯凸包模板:/*ID:zlqest11LANG: C++TASK: fc*/#include <iostream>#include <cstdio>#include <cstring>#include <cmath>#include <algorithm>using namespace std;const int N = 10005;const double eps = 1e-6;struct gPoint{ double x, y;}p[N];int n;//the convex 阅读全文

posted @ 2012-01-25 11:50 Moon_1st 阅读(350) 评论(0) 推荐(0) 编辑

导航