-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtsort.cpp
59 lines (44 loc) · 791 Bytes
/
tsort.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
/*
int get_numb(const string& line){
int val;
bool gotValue;
for(int i = 0;i< line.length(); i++){
if(line[i] == ' '){
if(gotValue) return val;
value = 0;
gotValue = false;
continue
}
value = value*10 + line[i] - '0';
gotValue = true
}
if(gotValue) return val;
return -1;
}*/
/*
class FastIO{
};
*/
int main(){
fp = stdin;
int t;
fscan
cin >> t;
int holder[t];
int counting_sort[1000001] = {};
int cur_val;
for(int i=0; i<t; i++){
cin >> cur_val;
counting_sort[cur_val] += 1;
}
for(int i= 0; i < 1000001;i++){
cur_val = counting_sort[i];
for(int j=0; j < cur_val; j++){
cout << i << endl;
}
}
}