Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.006 s | 1 KBi |
#2 |
Correcto
|
0.006 s | 1 KBi |
#3 |
Correcto
|
0.007 s | 1 KBi |
#4 |
Correcto
|
0.006 s | 1 KBi |
#5 |
Correcto
|
0.007 s | 1 KBi |
#6 |
Correcto
|
0.007 s | 1 KBi |
#7 |
Correcto
|
0.006 s | 1 KBi |
#8 |
Correcto
|
0.007 s | 1 KBi |
#9 |
Correcto
|
0.006 s | 1 KBi |
#10 |
Correcto
|
0.006 s | 1 KBi |
#include <iostream> #include <cstring> #include <cstdio> #include <cmath> #include <queue> #include <set> #include <map> #include <vector> #include <stack> #include <algorithm> using namespace std; int main() { int n, c, este; int max = 0; vector <int> a; int p[500001]; cin>>n; for(int i = 0; i < n; i++) { cin>>este; a.push_back(este); } sort( a.begin(), a.end() ); //cout<<endl; //cout<<endl<<"a[0]="<<a[0]<<endl; cin>>c; while(c--) { cin>>este; int j = 0; //cout<<este<<" <= "<<a[j]<<endl; while( j < n && este >= a[j] ) { j++; } //cout<<"a[j]="<<a[j]<<endl; cout<<n-j<<endl; } }