2 solutions

  • 0
    @ 2026-7-9 15:35:04
    #include<bits/stdc++.h>
    using namespace std;
    int s1[1010]; 
    int main()
    {
        int n,m;
        bool b=true;
        cin>>n>>m;
        for(int i=1;i<=m;i++){
            int a;
            cin>>a;
            s1[a]=-1;
        }
        for(int i=1;i<n;i++){
            if(s1[i]!=-1) {
                cout<<i<<' ';
                b=false;
            }
        }
        if(b) cout<<n;
        return 0;
    }
    

    Information

    ID
    1180
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    1
    Tags
    (None)
    # Submissions
    53
    Accepted
    20
    Uploaded By