Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.006 s | 4 KBi |
#2 |
Correcto
|
0.005 s | 5 KBi |
#3 |
Correcto
|
0.006 s | 2 KBi |
#4 |
Correcto
|
0.006 s | 1 KBi |
#5 |
Correcto
|
0.004 s | 1 KBi |
#6 |
Correcto
|
0.006 s | 2 KBi |
#7 |
Correcto
|
0.007 s | 16 KBi |
#8 |
Correcto
|
0.007 s | 25 KBi |
#9 |
Correcto
|
0.006 s | 2 KBi |
#10 |
Correcto
|
0.005 s | 2 KBi |
#include <iostream> #include <vector> int main() { int n,c; long number, num = -999999999; std::vector <long> numbers; std::vector <std::pair <long, int> > queries; std::cin >> n; for (int i = 0; i < n; ++i){ std::cin >> number; numbers.push_back(number); } std::cin >> c; for (int i = 0; i < c; i++) { std::cin >> number; queries.push_back(std::make_pair(number,0)); } for (int i = 0; i < queries.size(); ++i) { for (int j = 0; j < numbers.size(); ++j) { if (queries.at(i).first < numbers.at(j)) queries.at(i).second++; } } for (int i = 0; i < queries.size(); i++) { std::cout << queries.at(i).second << "\n"; } return 0; }