Cod sursa(job #726794)

Utilizator morlockRadu Tatomir morlock Data 27 martie 2012 15:29:52
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 long long
using namespace std;

ifstream in("algsort.in");
ofstream out("algsort.out");

int n;
multiset<ll> h;
multiset<ll>::iterator it;

int main()
{ ll x;

    in>>n;
    for ( int i=1; i<=n; ++i )
     {
         in>>x;
         h.insert(x);
     }

    for ( it=h.begin(); it != h.end(); ++it )
     out<<*it<<" ";

return 0;
}