Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.007 s | 1 KBi |
#2 |
Correcto
|
0.006 s | 1 KBi |
#3 |
Correcto
|
0.005 s | 2 KBi |
#4 |
Correcto
|
0.006 s | 56 KBi |
#5 |
Correcto
|
0.005 s | 7 KBi |
#6 |
Correcto
|
0.006 s | 2 KBi |
#7 |
Correcto
|
0.008 s | 15 KBi |
#8 |
Correcto
|
0.005 s | 2 KBi |
#9 |
Correcto
|
0.005 s | 2 KBi |
#10 |
Correcto
|
0.008 s | 17 KBi |
#11 |
Correcto
|
0.109 s | 17 KBi |
#12 |
Correcto
|
0.092 s | 1 KBi |
#13 |
Correcto
|
0.075 s | 2 KBi |
#14 |
Correcto
|
0.08 s | 1 KBi |
#15 |
Correcto
|
0.103 s | 2 KBi |
#16 |
Correcto
|
0.035 s | 2 KBi |
#17 |
Correcto
|
0.06 s | 1 KBi |
#18 |
Correcto
|
0.036 s | 1 KBi |
#19 |
Correcto
|
0.047 s | 1 KBi |
#20 |
Correcto
|
0.061 s | 18 KBi |
#include <iostream> #include <vector> int main() { int n, number, temp; std::vector <int> numbers; std::cin >> n; for (int i = 0; i < n; ++i){ std::cin >> number; numbers.push_back(number); } for (int i = 0; i < numbers.size(); ++i) { for (int j = 1; j < numbers.size(); ++j) { if (numbers.at(j-1) >= numbers.at(j)) { temp = numbers.at(j); numbers.at(j) = numbers.at(j-1); numbers.at(j-1) = temp; } } } for (int i = 0; i < numbers.size()-1; i++) { std::cout << numbers.at(i) << " "; } std::cout << numbers.at(numbers.size()-1) << "\n"; return 0; }