Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.006 s | 1 KBi |
#2 |
Correcto
|
0.006 s | 1 KBi |
#3 |
Correcto
|
0.006 s | 1 KBi |
#4 |
Correcto
|
0.006 s | 1 KBi |
#5 |
Correcto
|
0.006 s | 1 KBi |
#6 |
Correcto
|
0.007 s | 1 KBi |
#7 |
Correcto
|
0.066 s | 2 KBi |
#8 |
Correcto
|
0.055 s | 2 KBi |
#9 |
Correcto
|
0.05 s | 2 KBi |
#10 |
Correcto
|
0.064 s | 2 KBi |
#11 |
Correcto
|
0.061 s | 3 KBi |
#12 |
Correcto
|
0.062 s | 3 KBi |
#13 |
Correcto
|
0.049 s | 2 KBi |
#14 |
Correcto
|
0.039 s | 2 KBi |
#15 |
Correcto
|
0.096 s | 2 KBi |
#16 |
Correcto
|
0.086 s | 3 KBi |
#17 |
Correcto
|
0.068 s | 3 KBi |
#18 |
Correcto
|
0.052 s | 2 KBi |
#19 |
Correcto
|
0.049 s | 2 KBi |
#20 |
Correcto
|
0.049 s | 2 KBi |
#21 |
Correcto
|
0.044 s | 2 KBi |
#22 |
Correcto
|
0.126 s | 2 KBi |
#23 |
Correcto
|
0.125 s | 2 KBi |
#24 |
Correcto
|
0.122 s | 2 KBi |
#25 |
Correcto
|
0.127 s | 2 KBi |
#26 |
Correcto
|
0.119 s | 2 KBi |
#27 |
Correcto
|
0.128 s | 2 KBi |
#include <iostream> #include <cstring> #include <cstdio> #include <cmath> #include <queue> #include <set> #include <list> #include <map> #include <vector> #include <stack> #include <algorithm> #define forn(a, n) for(int a = 0; a<(int) (n); ++a) #define rforn(a, n) for(int a = (n)-1; a>=0; --a) using namespace std; const int N = 6e5+20; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n, pos, temp, este; cin>>n; //int a [1001]; vector <int> a; for(int i = 0; i < n; i++) { //cin>>a[i]; cin>>este; a.push_back(este); } sort(a.begin(), a.end()); //antes de empezar, quiero ver si coge la trampa // --- QUICK SORT --- -> XXX /* for(int i = 0; i < n-1; i++) { int min = N; for(int j = i; j < n; j++) { if(a[j] < min) { min = a[j]; pos = j; } } if(min != N) { temp = a[i]; a[i] = a[pos]; a[pos] = temp; } } */ // --- MERGE SORT --- -> XXX for(int i = 0; i < n; i++) { cout<<a[i]<<" "; } cout<<endl; }