Pagini recente » Cod sursa (job #890380) | Cod sursa (job #2229409) | Cod sursa (job #1790658) | Cod sursa (job #2740000) | Cod sursa (job #1105039)
#include<fstream>
using namespace std;
#include<algorithm>
#include<set>
ifstream f("lupu.in");
ofstream g("lupu.out");
#define nmax 100010
long long sol
int n,x,d;
struct elem
{
int nr;
int x;
} l[nmax],poz[nmax]
struct cmp
{
bool operator()(elem &a,elem &b)
{
return a.x<b.x; //heap de maxim !!!OBS: daca era de min puneam >.
}
};
bool comp (elem a,elem b)
{
return a.x>b.x;
};
multiset <elem,cmp> h;
int main()
{
f>>n>>x>>d;
for(int i=1;i<=n;i++)
{
f>>poz[i].x>>l[i].x;
poz[i].nr=l[i].nr=i;
}
sort(l+1,l+n+1,comp);
sort(poz+1,poz+n+1,comp);
return 0;
}