Cod sursa(job #1982133)
| Utilizator | Data | 17 mai 2017 18:58:22 | |
|---|---|---|---|
| Problema | Lupul Urias si Rau | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.54 kb |
#include <fstream>
#include <algorithm>
using namespace std;
ifstream fin("proc2.in");
ofstream fout("proc2.out");
int n,x,l;
int d,a;
pair <int,int> v[100005];
int nh;
bool cmp(pair a,pair b)
{
return (a.first<b.first?1:0);
}
void urca(int p)
{
while (p>1) {
if (h[p]<h[p/2]) {
swap(h[p],h[p/2]);
p/=2;
}
}
}
void adauga(int x)
{
h[++nh]=x;
urca(x);
}
int main()
{
fin>>n>>x>>l;
for (int i=1;i<=n;i++) {
fin>>v[i].first>>v[i].second;
}
sort(v+1,v+n+1,cmp);
}
