Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.005 s | 10 KBi |
#2 |
Correcto
|
0.004 s | 0 KBi |
#3 |
Correcto
|
0.005 s | 1 KBi |
#4 |
Correcto
|
0.005 s | 1 KBi |
#5 |
Correcto
|
0.004 s | 1 KBi |
#6 |
Correcto
|
0.004 s | 1 KBi |
#7 |
Correcto
|
0.005 s | 1 KBi |
#8 |
Correcto
|
0.005 s | 0 KBi |
#9 |
Correcto
|
0.002 s | 0 KBi |
#10 |
Correcto
|
0.005 s | 0 KBi |
#include <iostream> #include <vector> using namespace std; void solve (vector<int> a, int n, int x); int main() { int n; cin >> n; vector<int> array(n); for (int i = 0; i < n; i++) { cin >> array[i]; } int c; cin >> c; for (int i = 0; i < c; i++) { int x; cin >> x; solve(array, n, x); } return 0; } void solve (vector<int> a, int n, int x) { int counter = 0; for (int i = 0; i < n; i++) { int current = a[i]; if (current > x) { counter++; } } cout << counter << endl; }