Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- , \ / ,
- / \ )\__/( / \
- / \ (_\ /_) / \
- ____/_____\__\@ @/___/_____\____
- | |\../| |
- | \VV/ |
- | ------___------- |
- |__________Chuta Dragon___________|
- | /\ / \\ \ /\ |
- | / V )) V \ |
- |/ ` // ' \|
- ` V '
- */
- #include<bits/stdc++.h>
- using namespace std;
- typedef long long ll;
- #define fastread() (ios_base:: sync_with_stdio(false),cin.tie(NULL))
- #define fi first
- #define se second
- #define pb push_back
- #define eb emplace_back
- void input(ll ara[],ll n)
- {
- for(ll i=0; i<n; i++)
- cin>>ara[i];
- }
- #define eb emplace_back
- int main()
- {
- fastread();
- ll n,a,q,i;
- cin>>n;
- vector<ll>v;
- for(i=0; i<n; i++)
- {
- cin>>a;
- v.pb(a);
- }
- // v.pb(*min_element(v.begin(),v.end()));
- sort(v.begin(),v.end());
- cin>>q;
- while(q--)
- {
- cin>>a;
- ll ans=upper_bound(v.begin(),v.end(),a)-v.begin();
- cout<<ans<<endl;
- }
- }
- //////////////////////////////////////////////////////////////////////////////////////////////////////
- // //
- // //
- // _____________ //
- // ++++++++++ ___------------------\\\\ //
- // +++`+``+`+`++++ ///`````````````````````````````\\\ //
- // ++`+`+``+++`++++ /////```````````````````````````````````\\ //
- // +++`++`+`+``+++/////`````````````````````````````````````````\\ //
- // +++`++`+``+///```````````|```````````````````````````````````\\ //
- // ____++++/++++/`````````````/````````|````````|```````````````````\\ //
- // / / / | //``````````````|````````|```````|````````|````````````\\ //
- // / / / | ///````````/```````|```````||```````|````````|``````\```````\\ //
- // | / / |///`````````|``````/````````|````````|````````|```````|```````\\ //
- // |/ | |//``|```````|``````|````````|`````````|```````|```````|````````\\ //
- // /\___|__//`|``|```````|` | ``:|````````|:```````|```````|```|`````| //
- // / / /``|``|``````|/ | :| ```:|```````|```````|``++````++ //
- // / / //```|``|``````| | |: :| ```|```````|```++``++`\ //
- // | / /````|``|``````/ _.::::. | | | ````|```|`++`\`| //
- // | / |````|``|`````| ` | ``|```++``++`| //
- // | / |````|``|`````| : |``++````++| //
- // | / /````|``|`````| _.-:::. |..`|``.`|.| //
- // |/ /`````|``|`````| ` |```|````|`| //
- // /| |`````|``|`````| :' .|```|````|.| //
- // / | |`````|``|`````| /|-|``|````|`| //
- // / | |`````|```\````| / ||```|````|``\ //
- // / | |`````|````|```|:: /_| ||```|````|``| //
- // |`````|````|```|:|:. `.._ .\___/:|```|````|``| //
- // |`````\````|```|:|::- ``:::.... -:|:|:::|```|````|``| //
- // |``````|```|```|:|::`|. .:::|:|:::|```|````|``| //
- // \`````|```|```|:|::/|--. .`:|:::|:|:::/```|````|``| //
- // |````|```|```\:|:|:|----- _..-:|:|:|:::|:|::|````|````|`/ //
- // |````|```|````\|:|:|-------.____.....------|/::|:::|:|::|````|````|`| //
- // |````|```|\````\:|/\___________ ________/\--\:::|:|::|````/````|`| //
- // |````\```| \```|:/-------------\ /----------\``\::|:|::|```/`````|`| //
- // |`````|``| \``|/---------------\/------------\_________|```|`````|`| //
- // //
- //////////////////////////////////////////////////////////////////////////////////////////////////////
- // //
- // Created by Aeren //
- // //
- //////////////////////////////////////////////////////////////////////////////////////////////////////
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement