code
#include<bits/stdc++.h>
using namespace std;
const int N = 100010;
int a[N],b[N];
int main(){
int n, m;
cin >> n >> m;
for(int i = 1; i <= n; i++) cin >> a[i];
for(int i = 1; i <= m; i++) cin >> b[i];
int i = 1, j = 1;
while(i <= n && j <= m){
if(a[i] == b[j]) i++, j++;
else j++;
}
if(i == n + 1)
cout <<"Yes";
else
cout << "No";
return 0;
}
标签:std,判断,acwing2816,int,namespace,序列,main
From: https://www.cnblogs.com/index-12/p/17297172.html