2014年1月6日

POJ 2796 Feel Good 并查集

摘要: 答案为0时要输出一个合理的区间...这是个坑.-----------------------const int maxn=110000;const int maxm=10000;int n;int a[maxn];struct Dat{ int v; int idx;};bool cmp(const Dat& a,const Dat& b){ return a.v>b.v;}Dat b[maxn];int L[maxn],R[maxn],Mis[maxn];int pa[maxn];void makeset(int n){ for (int i=0;i1&& 阅读全文

posted @ 2014-01-06 22:21 电子幼体 阅读(174) 评论(0) 推荐(0) 编辑

POJ 2970 The lazy programmer 优先队列

摘要: --------------const double EPS = 1e-7;const int maxn=150000;int dcmp(double a,double b){ if (abs(a-b)b) return 1; else return -1;}struct Dat{ int a,b,d; double c; bool operatorque;int n;Dat a[maxn];int main(){ while (~scanf("%d",&n)){ while (!que.empty()) que.pop(); f... 阅读全文

posted @ 2014-01-06 00:53 电子幼体 阅读(312) 评论(0) 推荐(0) 编辑

导航