Cod sursa(job #726809)
| Utilizator | Data | 27 martie 2012 15:36:25 | |
|---|---|---|---|
| Problema | Sortare prin comparare | Scor | 60 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.44 kb |
#include <iostream>
#include <fstream>
#include <set>
#define nmax 500005
#define ll int
using namespace std;
ifstream in("algsort.in");
ofstream out("algsort.out");
int n;
multiset<ll> h;
int main()
{ ll x;
in>>n;
for ( int i=1; i<=n; ++i )
{
in>>x;
h.insert(x);
}
while ( !h.empty() )
{
out<<*h.begin()<<" ";
h.erase( h.begin() );
}
return 0;
}
