Skip to content

Instantly share code, notes, and snippets.

@joaogui1
Last active July 3, 2016 18:21
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 joaogui1/9e40e97879505c9ee88cf1b3e4cbca80 to your computer and use it in GitHub Desktop.
Save joaogui1/9e40e97879505c9ee88cf1b3e4cbca80 to your computer and use it in GitHub Desktop.
//ordenação usando a STL
int n, v[100000];
cin >> n;
for(int i = 0; i < n; ++i){
cin >> v[i]; //custa O(n)
}
sort(v, v + n); //ordena o vetor, custa O(nlog(n))
//n + nlog(n) = O(nlog(n))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment