代码语言:javascript复制
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<cmath>
using namespace std;
const int maxn = 1000010;
int value[maxn];
int money[maxn];
int n,m;
int main()
{
scanf("%d",&n);
for(int i=0;i<n;i )
scanf("%d",&value[i]);
scanf("%d",&m);
for(int i=0;i<m;i )
scanf("%d",&money[i]);
sort(value,value n);
for(int i=0;i<m;i )
{
int pos = upper_bound(value,value n,money[i])-value;
cout<<pos<<endl;
}
}