MDeath-Kid

- M I T & Y
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2011年7月21日

摘要: 求相交的公路,对N排序,然后对M求逆序对,不过要求有相交的,必然要求在次城市后面,所以int sumge = i - (qur(s[tmp].y)) - ge;,这里修改了老多次,不过还好1Y了。3067#define lowbit(x) x & -xstruct sta{ int x,y;};sta s[MAXN];int n,m,k,maxx;int num[1005];int cmp(const void *a,const void *b){ struct sta *c = (sta *)a; struct sta *d = (sta *)b; if(c->x == d-& 阅读全文

posted @ 2011-07-21 16:50 MDeath-Kid 阅读(146) 评论(0) 推荐(0) 编辑

摘要: 求逆序对,数据量大,离散化,当然,这是树状数组的做法。2299#define FOPEN freopen("d:\\1.txt","r",stdin)#define lowbit(x) x & -xstruct sta{ int va,idx; int sta;};sta s[MAXN];int n,a;int num[MAXN];int cmp(const void *a,const void *b){ struct sta *c = (sta *)a; struct sta *d = (sta *)b; return d->va - c 阅读全文

posted @ 2011-07-21 16:46 MDeath-Kid 阅读(251) 评论(0) 推荐(0) 编辑