Skip to content

Instantly share code, notes, and snippets.

@autotaker
Last active December 22, 2015 06:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save autotaker/1b7a9a6f6b9c0f446ae5 to your computer and use it in GitHub Desktop.
Save autotaker/1b7a9a6f6b9c0f446ae5 to your computer and use it in GitHub Desktop.
#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