poj2481,一直是超时。。。
#include<stdio.h>
#include <vector>
#include <algorithm>
using namespace std;
const int N = 100001;
class term
{
public:
term(int s,int e,int id):s(s),e(e),id(id){}
int s;
int e;
int id;
};
class Cmp
{
public:
bool operator()(const term & t1,const term &t2)
{
if(t1.e>t2.e)
return true;
if(t2.e == t1.e)
return t1.s <= t2.s;
return false;
}
};
int c[N];
int rst[N];
int lowbit(int i)
{
return i&(-i);
}
i......
阅读全文