PROBLEM: http://codeforces.com/problemset/problem/706/B
#include<bits/stdc++.h> using namespace std; long long ar[1000002]; int main() { long long n,m,c,i,j,br; while(cin>>n) { for(i=0; i<n; i++) cin>>ar[i]; sort(ar,ar+n); cin>>m; for(j=0; j<m; j++) { cin>>br; c=upper_bound(ar,ar+n,br)-ar; cout<<c<<endl; } } return 0; }
No comments:
Post a Comment