上一页 1 ··· 3 4 5 6 7
摘要: #include#include#include#includeusing namespace std;#define maxn 210000int ch[maxn][2],pre[maxn];int siz[maxn];bool rt[maxn];void pushup(int x){ siz[x]=1+siz[ch[x][0]]+siz[ch[x][1]];}void rotate(int x){ int y=pre[x],k=ch[y][0]==x; ch[y][!k]=ch[x][k]; pre[ch[x][k]]=y; pre[x]=pre[y]; pre[y]=x... 阅读全文
posted @ 2014-02-15 21:56 wangyucheng 阅读(134) 评论(0) 推荐(0) 编辑
摘要: #include#include#include#include#includeusing namespace std;#define dd double#define eps 1e-7#define maxn 220000int n;struct P{ dd x,y; }a[maxn];dd mul(P a1,P a2,P c){ return (a1.x-a2.x)*(c.y-a2.y)-(a1.y-a2.y)*(c.x-a2.x);}bool cross(P a1,P a2,P b1,P b2){ if(min(a1.x,a2.x)<=max(b1.x,b2.x)&& 阅读全文
posted @ 2014-02-03 22:24 wangyucheng 阅读(147) 评论(0) 推荐(0) 编辑
摘要: #include#include#include#includeusing namespace std;#define eps 1e-7#define dd double#define maxn 300int T;int n;structP{ dd x,y; }a[maxn];bool ling(dd x){ if(x>-eps&&x0)continue; if(r1>0&&r2<0)continue; p=1; } if(!p){ // cout<<i<<" "<<j<<en 阅读全文
posted @ 2014-02-03 18:46 wangyucheng 阅读(151) 评论(0) 推荐(0) 编辑
摘要: #include#include#include#define eps 1e-7#define maxn 8000using namespace std;#define ll long longstruct point{ ll x,y;};int n,m;ll x1,y1,x2,y2;point a[maxn],b[maxn];ll mul(ll a1,ll b1,ll a2,ll b2){return a1*b2-a2*b1;}bool left(point x,point y){if(mul(x.x-y.x,x.y-y1,y.y-y.x,y2-y1)>0)return 1;else 阅读全文
posted @ 2014-02-03 18:44 wangyucheng 阅读(115) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7