Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
36398 | 邢皓睿 | 公交换乘站 | C++ | Accepted | 2 MS | 724 KB | 286 | 2022-08-08 14:58:56 |
#include<iostream> using namespace std; int main(){ int 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; }