不是,谁能告诉我这是怎么WA的
查看原帖
不是,谁能告诉我这是怎么WA的
179871
Lithium_Chestnut楼主2024/7/30 16:32

???

#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int N=1e5+1;
ll n,m,a,b[N];
set<ll> s;
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cin>>n>>m;
    for(int i=1;i<=n;i++)
    {
        cin>>a;
        s.insert(a);
    }
    for(int i=1;i<=m;i++) cin>>b[i];
    sort(b+1,b+m+1);
    for(int i=1;i<=m;i++)
    {
        if(s.find(b[i])!=s.end()) cout<<b[i]<<" ";
    }
    return 0;
}

2024/7/30 16:32
加载中...