Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
36396 | 吴泽贤 | 公交换乘站 | C++ | Accepted | 1 MS | 728 KB | 295 | 2022-08-08 14:58:36 |
#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; }