Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.005 s | 1 KBi |
#2 |
Correcto
|
0.006 s | 1 KBi |
#3 |
Correcto
|
0.005 s | 1 KBi |
#4 |
Correcto
|
0.005 s | 1 KBi |
#5 |
Correcto
|
0.005 s | 5 KBi |
#6 |
Correcto
|
0.006 s | 64 KBi |
#7 |
Correcto
|
0.007 s | 1 KBi |
#8 |
Correcto
|
0.005 s | 1 KBi |
#9 |
Correcto
|
0.005 s | 1 KBi |
#10 |
Correcto
|
0.005 s | 1 KBi |
#include <iostream> #include <vector> using namespace std; vector<int> processLine(int N) { vector<int> elements(N); for (int i=0; i < N; i++) { cin >> elements[i]; } return elements; } int solve(int q, int N, vector<int> elements) { int max_counter = 0; for (int i=0; i < N;i++) { if (q < elements[i]) {max_counter++;} } return max_counter; } int main() { int N, C, q, solution; vector<int> elements; cin >> N; elements = processLine(N); cin >> C; for(int i=1; i<=C; i++) { cin >> q; solution = solve(q, N, elements); cout << solution << endl; } }