Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
36399 | 朱涵璟皓 | 公交换乘站 | C++ | Accepted | 2 MS | 728 KB | 309 | 2022-08-08 14:59:23 |
#include<iostream> 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; }