60pts悬关求救!caosi啦
查看原帖
60pts悬关求救!caosi啦
977778
__Harry_Haiyun__楼主2023/8/28 09:26
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int maxn = 1e6+7;
const int MAXN = maxn / 2;
int n,m,a[maxn],b[maxn];
//queue<int>q;
signed main()
{
 	ios::sync_with_stdio(false);
 	cin.tie(NULL);
 	cin >> n >> m;
 	for (int i = 0; i < n; i++) cin >> a[i];
 	for (int i = 0; i < m; i++) cin >> b[i];
 	for (int i = 0; i < n; i++)
 		for (int j = 0; j < m; j++)
 			if (a[i] == b[j])
 				cout << a[i] << ' ';
 	//cout << cnt;
 	return 0;
}
2023/8/28 09:26
加载中...