Last active
December 22, 2015 06:58
-
-
Save autotaker/1b7a9a6f6b9c0f446ae5 to your computer and use it in GitHub Desktop.
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<cstdio> | |
#include<chrono> | |
using namespace std; | |
int main(void) | |
{ | |
vector<int> vs; | |
int v; | |
while( scanf("%d",&v) != EOF ) { | |
vs.push_back(v); | |
} | |
auto start = chrono::system_clock::now(); | |
sort( vs.begin(), vs.end() ); | |
auto end = chrono::system_clock::now(); | |
auto elapsed = chrono::duration_cast<std::chrono::milliseconds>(end-start).count(); | |
cerr << "Sorting: " << elapsed << "ms" << endl; | |
for( auto &v : vs ) { | |
printf("%d\n",v); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment