Cod sursa(job #2575354)
Utilizator | Data | 6 martie 2020 13:02:31 | |
---|---|---|---|
Problema | Radix Sort | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.42 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin("radixsort.in");
ofstream fout("radixsort.out");
int x;
unordered_map < int, int > freq;
set < int > S;
int main()
{
while (fin >> x)
{
if (freq[x]++ == 0)
S.insert(x);
}
for (auto it: S)
{
int N = freq[it];
for (int i = 1; i <= N; i++)
fout << it << " ";
}
return 0;
}