Created
September 29, 2016 19:14
-
-
Save yogurt1/35a305418a6c3f4125888b0e352709b8 to your computer and use it in GitHub Desktop.
Sort from god
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <algorithm> | |
#include <iterator> | |
int main(void) { | |
std::ios::sync_with_stdio(false); | |
int len; | |
std::cin >> len; | |
std::vector<int> vec(201); | |
/* Read array */ | |
int t; | |
for (int i = 0; i < len; i++) { | |
std::cin >> t; | |
vec[t+100]++; | |
} | |
for (int i = 0; i < vec.size(); i++) { | |
for (int j = 0; j < vec[i]; j++) { | |
std::cout << i - 100 << ' '; | |
} | |
} | |
std::cout << "\n"; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment