Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
36393 马祎杨 公交换乘站 C++ Accepted 1 MS 728 KB 295 2022-08-08 14:57:37

Tests(3/3):


Code:

#include<bits/stdc++.h> using namespace std; int main() { char a[205]={0}; int m,n,x,cnt=0; cin>>m>>n; for(int i=0;i<m;i++){ cin>>x; a[x]=1; } for(int j=0;j<n;j++){ cin>>x; if(a[x]==1){ cout<<x<<" "; cnt++; } } if(cnt==0) cout<<-1; return 0; }