Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.006 s | 0 KBi |
#2 |
Correcto
|
0.005 s | 0 KBi |
#3 |
Correcto
|
0.005 s | 0 KBi |
#4 |
Correcto
|
0.005 s | 0 KBi |
#5 |
Correcto
|
0.006 s | 0 KBi |
#6 |
Correcto
|
0.004 s | 0 KBi |
#7 |
Correcto
|
0.063 s | 1 KBi |
#8 |
Correcto
|
0.064 s | 1 KBi |
#9 |
Correcto
|
0.066 s | 1 KBi |
#10 |
Correcto
|
0.109 s | 1 KBi |
#11 |
Correcto
|
0.125 s | 2 KBi |
#12 |
Correcto
|
0.104 s | 2 KBi |
#13 |
Correcto
|
0.089 s | 3 KBi |
#14 |
Correcto
|
0.079 s | 1 KBi |
#15 |
Correcto
|
0.123 s | 1 KBi |
#16 |
Correcto
|
0.141 s | 2 KBi |
#17 |
Correcto
|
0.129 s | 2 KBi |
#18 |
Correcto
|
0.067 s | 1 KBi |
#19 |
Correcto
|
0.091 s | 5 KBi |
#20 |
Correcto
|
0.072 s | 1 KBi |
#21 |
Correcto
|
0.068 s | 2 KBi |
#22 |
Correcto
|
0.172 s | 1 KBi |
#23 |
Correcto
|
0.171 s | 2 KBi |
#24 |
Correcto
|
0.181 s | 4 KBi |
#25 |
Correcto
|
0.165 s | 1 KBi |
#26 |
Correcto
|
0.166 s | 1 KBi |
#27 |
Correcto
|
0.221 s | 2 KBi |
#include <bits/stdc++.h> using namespace std; #define vi vector<int> int partition(int l, int r, vi &arr) { int pivot = arr[r]; int index = l; for (int j = l; j <= r; ++j) { if (arr[j] < pivot) { swap(arr[j], arr[index]); index++; } } swap(arr[r], arr[index]); return index; } void quickSort(int l, int r, vi &arr) { if (l < r) { int pivot = partition(l, r, arr); if (l < pivot - 1) quickSort(l, pivot - 1, arr); if (pivot + 1 < r) quickSort(pivot + 1, r, arr); } } int main() { int n; cin >> n; vi arr(n); for (auto &num : arr) cin >> num; // quickSort(0, n-1, arr); sort(arr.begin(), arr.end()); for (auto x : arr) cout << x << " "; cout << endl; return 0; }