Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // In the name of Allah.
- // We're nothing and you're everything.
- // Ya Ali!
- /*
- , \ / ,
- / \ )\__/( / \
- / \ (_\ /_) / \
- ____/_____\__\@ @/___/_____\____
- | |\../| |
- | \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
- ll const MOD=1000000007;
- ///-------------------------------------------------------------------------------------------------///
- /// KARMA IS LIKE 69,,, YOU GET WHAT YOU GIVE ///
- ///-------------------------------------------------------------------------------------------------///
- #define eb emplace_back
- int main()
- {
- fastread();
- ll n;
- cin>>n;
- ll ara[n+1]={0},bra[n+1];
- for(ll i=0;i<n;i++)
- {
- cin>>ara[i];
- }
- for(ll i=0;i<n;i++)
- {
- cin>>bra[i];
- m[i+1]
- }
- ll m[n+1];
- for(ll i=1;i<=n;i++)
- {
- cout<<"m ="<<i<<" "<<m[i]<<endl;
- }
- vector<ll>v;
- ll num;
- for(ll i=1;i<=n;i++)
- {
- num=m[i];
- vector<ll>::iterator iv=lower_bound(v.begin(),v.end(),num);
- if(v.end()==iv)
- { cout<<num<<" = num"<<endl;
- v.push_back(num);
- }
- else {
- cout<<iv-v.begin()<<" pos "<<" num="<<num<<endl;
- v[iv-v.begin()]=num;
- }
- }
- for(auto x:v)cout<<x<<" ";
- cout<<endl;
- cout<<v.size()<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement