Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
36390 边玥心 公交换乘站 C++ Accepted 1 MS 728 KB 300 2022-08-08 14:53:05

Tests(3/3):


Code:

#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; }