80pts求救
查看原帖
80pts求救
551100
Hoks楼主2022/7/24 21:53
#include<bits/stdc++.h>
#define int long long
using namespace std;
int n;
int a[1000010],book[1000010];
int read()
{
	char c=getchar();int x=0;
	while(!isdigit(c)) c=getchar();
	while(isdigit(c)) x=(x<<1)+(x<<3)+(c^48),c=getchar();
	return x;
}
signed main()
{
	n=read();
	for(int i=1;i<=n;i++) a[i]=read();
	for(int i=1,x;i<=n;i++)
	{
		x=read();
		if(x==a[i]) book[x]=1;
	}
	int i=0;
	while(book[i]) i++;
	cout<<n-i;
	return 0;
}
2022/7/24 21:53
加载中...