A 大水题B 模拟题,要很小心,注意细节处理C 给你在一个正多边形上的三个点,判断这个多边形的最小面积。由于这个多边形最多只有100条边,可以直接枚举多边形的边数计算是否满足判断是否满足:三个点组成的三角形的每个角是圆周角的整数倍判断整数的时候精度不宜太大View Code #include<cstdio>#include<cstring>#include<cmath>#include<cstdlib>using namespace std;const double eps = 1e-8;const double pi = acos(-1.0); Read More
posted @ 2012-05-17 21:34 Because Of You Views(260) Comments(0) Diggs(0) Edit
貌似和以前做过的某道题一模一样,离线查询在这里http://www.cnblogs.com/wuyiqi/archive/2012/02/13/2349290.htmlView Code #include<cstdio>#include<cstring>#include<map>#include<algorithm>using namespace std;const int maxn = 50010;__int64 c[maxn];struct node{ int l,r,id;}p[200010];map<int,int> Hash Read More
posted @ 2012-05-17 17:06 Because Of You Views(227) Comments(0) Diggs(0) Edit
此题有一个关键的地方决定了可以使用树状数组来搞:所有询问的区间不相互包含,但可能交叉这样就可以从左往右边添加边删除用树状数组来做了如果存在包含关系,就不能用树状数组搞了,原因的话看看poj 2104的样例数据就明白了View Code #include<cstdio>#include<cstring>#include<algorithm>using namespace std;const int maxn = 100010;struct node{ int key,id; bool operator < (const node & cm)con Read More
posted @ 2012-05-17 16:59 Because Of You Views(787) Comments(0) Diggs(0) Edit
A 给你一个环,环上的每条边都有一个方向,按某个方向(顺时针或逆时针)走一遍,把与行走的方向相反的边反向,并加上相应的费用,判断走哪个方向的费用比较少直接dfs搞即可View Code #include<cstdio>#include<cstring>#include<vector>#include<algorithm>using namespace std;int out[110];vector<int> edge[110];int flag[110][110];int mm[110][110];int vis[110];vecto Read More
posted @ 2012-05-17 05:51 Because Of You Views(381) Comments(0) Diggs(0) Edit