Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Incorrecto
|
0.005 s | 1 KBi |
#2 |
Incorrecto
|
0.005 s | 1 KBi |
#3 |
Incorrecto
|
0.005 s | 1 KBi |
#4 |
Incorrecto
|
0.004 s | 1 KBi |
#5 |
Incorrecto
|
0.004 s | 1 KBi |
#6 |
Incorrecto
|
0.005 s | 1 KBi |
#7 |
Incorrecto
|
0.005 s | 1 KBi |
#8 |
Incorrecto
|
0.005 s | 1 KBi |
#9 |
Incorrecto
|
0.005 s | 66 KBi |
#10 |
Incorrecto
|
0.004 s | 1 KBi |
#include <iostream> #include <vector> using namespace std; int main() { // read initial array int n; cin >> n; vector<int> a(n); for (int i = 0; i < n; i++) { cin >> a[i]; } // Read queries int c; cin >> c; vector<int> q(c); for (int i = 0; i < c; i++) { cin >> q[i]; } // Count items, all counters start at 0 vector<int> r(c, 0); for (int i = 0; i < c; i++) { for (int j = 0; j < n; j++) { if (a[j] > q[i]) { r[i] = r[i] + 1; } } } for (int i = 0; i < c; i++) { cout << q[i] << endl; } return 0; }