1 solutions

  • 0
    @ 2025-11-27 11:58:16

    C++ :

    #include<bits/stdc++.h>
    using namespace std;
    int main(){
    	int n,s,m;
    	cin>>n>>m;
    	int arr[1000]={0};
    	for(int i=0;i<m;i++){
    		cin>>s;
    		arr[s]=1;
    	}
    	bool tag=0;
    	for(int i=0;i<n;i++){
    		if(arr[i]==0){
    			cout<<i<<' ';
    			tag=1;
    		}
    	}
    	if(tag == 0){
    		cout<<n;
    	}
        return 0;
    }
    
    • 1

    Information

    ID
    63
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By