Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.001 s | 0 KBi |
#2 |
Correcto
|
0.001 s | 0 KBi |
#3 |
Correcto
|
0.002 s | 0 KBi |
#4 |
Correcto
|
0.001 s | 0 KBi |
#5 |
Correcto
|
0.002 s | 0 KBi |
#6 |
Correcto
|
0.001 s | 0 KBi |
#7 |
Correcto
|
0.001 s | 0 KBi |
#8 |
Correcto
|
0.002 s | 0 KBi |
#9 |
Correcto
|
0.001 s | 0 KBi |
#10 |
Correcto
|
0.001 s | 0 KBi |
#include <iostream> using namespace std; int main() { int T, n; cin >> T; int numbers[T]; for (int k = 0; k < T; ++k) { cin >> numbers[k]; } cin >> n; int xNumbers[n]; for (int k = 0; k < n; ++k) { cin >> xNumbers[k]; } int answer[n]; int iterationTarget = 0; int count = 0; for (int j = 0; j < n; ++j) { for (int k = 0; k < T; ++k) { if (numbers[k] > xNumbers[j]) { count++; } } answer[iterationTarget++] = count; count = 0; } for (int k = 0; k < n; ++k) { cout << answer[k] << "\n"; } return 0; }