NewSjf @ 2019-08-31 12:09:34
不接受反驳
#include<bits/stdc++.h>
using namespace std;
int main(){
static int n,a,b[100001],c[100001],mp[100001];cin>>n;
for(int i=1;i<=n;i++)cin>>a,mp[a]=i,c[i]=252645135;
for(int i=1;i<=n;i++)cin>>b[i],*upper_bound(c+1,c+n+1,mp[b[i]])=mp[b[i]];
cout<<(upper_bound(c+1,c+1+n,n+1)-c-1);
}
by FZzzz @ 2019-08-31 12:28:12
@侯嘉诚 我说你到底想说什么
by Hjcc @ 2019-08-31 12:30:27
@function_of_zero 我好闲啊
by Purple_sword @ 2019-08-31 12:37:49
楼主没说要AC鸭
by critnos @ 2019-08-31 12:43:39
用printf可以把
using namespace std;
压掉
by critnos @ 2019-08-31 12:49:26
下标从0开始也可以压掉一堆“-1”
by Kuriyama_Mirai @ 2019-08-31 12:50:32
#import<bits/stdc++.h>
using namespace std;int i,n,A=2e5,a,b[A],c[A],m[A];main(){for(cin>>n;i<n;c[i++]=A)cin>>a,m[a]=i;for(i=-1;++i<n;cin>>b[i],*upper_bound(c,c+n,m[b[i]])=m[b[i]]);cout<<upper_bound(c,c+n,n+1)-c;}
(某些OJ可以通过编译)
by fzfnf @ 2019-08-31 13:03:26
有意思吗,(答:怎么就没有意思了
by Del_Your_Heart @ 2019-08-31 13:05:00
by FZzzz @ 2019-08-31 13:06:08
@侯嘉诚 gun
by libra9z @ 2019-08-31 13:13:18
#import<bits/stdc++.h>
using namespace std;int i,A=2e5,a,c[A],m[A];main(){for(cin>>n;i<n;c[i++]=A)cin>>a,m[a]=i;for(i=-1;++i<n;cin>>a,*upper_bound(c,c+n,m[a])=m[a]);cout<<upper_bound(c,c+n,n+1)-c;}
不接受反驳