5 条题解

  • 2
    @ 2025-11-5 19:21:38

    求个赞

    using namespace std;
    int main() {
        int n, m;
        cin >> n >> m;
        
        vector<bool> a(n, false);
        
        for (int i = 0; i < m; i++) {
            int id;
            cin >> id;
            a[id] = true;
        }
        
        vector<int> is;
        for (int i = 0; i < n; i++) {
            if (!a[i]) {    
                is.push_back(i);
            }
        }
        
        if (is.empty()) {
            cout << n;  
        } else {
            for (int i = 0; i < is.size(); i++) {
                if (i > 0) {
                    cout << " ";
                }
                cout << is[i];      
            }
        }
        
        return 0;
    }
    
    
    • 2
      @ 2025-11-5 19:21:36
      #include <algorithm>
      #include <stdio.h>
      #include <bitset>
      #include <string.h>
      #include <math.h>
      #include <cctype>
      #include <cerrno>
      #include <clocale>
      #include <cmath>
      #include <complex>
      #include <cstdio>
      #include <cstdlib>
      #include <cstring>
      #include <ctime>
      #include <deque>
      #include <exception>
      #include <fstream>
      #include <functional>
      #include <limits>
      #include <list>
      #include <map>
      #include <iomanip>
      #include <ios>
      #include <iosfwd>
      #include <iostream>
      #include <istream>
      #include <ostream>
      #include <queue>
      #include <set>
      #include <sstream>
      #include <stack>
      #include <stdexcept>
      #include <streambuf>
      #include <string>
      #include <utility>
      #include <vector>
      #include <cwchar>
      #include <cwctype>
      #include <complex.h>
      #include <fenv.h>
      #include <inttypes.h>
      #include <stdbool.h>
      #include <stdint.h>
      #include <tgmath.h>
      #include <algorithm>
      #include <stdio.h>
      #include <bitset>
      #include <string.h>
      #include <math.h>
      #include <cctype>
      #include <cerrno>
      #include <clocale>
      #include <cmath>
      #include <complex>
      #include <cstdio>
      #include <cstdlib>
      #include <cstring>
      #include <ctime>
      #include <deque>
      #include <exception>
      #include <fstream>
      #include <functional>
      #include <limits>
      #include <list>
      #include <map>
      #include <iomanip>
      #include <ios>
      #include <iosfwd>
      #include <iostream>
      #include <istream>
      #include <ostream>
      #include <queue>
      #include <set>
      #include <sstream>
      #include <stack>
      #include <stdexcept>
      #include <streambuf>
      #include <string>
      #include <utility>
      #include <vector>
      #include <cwchar>
      #include <cwctype>
      #include <complex.h>
      #include <fenv.h>
      #include <inttypes.h>
      #include <stdbool.h>
      #include <stdint.h>
      #include <tgmath.h>
      #include <algorithm>
      #include <stdio.h>
      #include <bitset>
      #include <string.h>
      #include <math.h>
      #include <cctype>
      #include <cerrno>
      #include <clocale>
      #include <cmath>
      #include <complex>
      #include <cstdio>
      #include <cstdlib>
      #include <cstring>
      #include <ctime>
      #include <deque>
      #include <exception>
      #include <fstream>
      #include <functional>
      #include <limits>
      #include <list>
      #include <map>
      #include <iomanip>
      #include <ios>
      #include <iosfwd>
      #include <iostream>
      #include <istream>
      #include <ostream>
      #include <queue>
      #include <set>
      #include <sstream>
      #include <stack>
      #include <stdexcept>
      #include <streambuf>
      #include <string>
      #include <utility>
      #include <vector>
      #include <cwchar>
      #include <cwctype>
      #include <complex.h>
      #include <fenv.h>
      #include <inttypes.h>
      #include <stdbool.h>
      #include <stdint.h>
      #include <tgmath.h>
      #include <algorithm>
      #include <stdio.h>
      #include <bitset>
      #include <string.h>
      #include <math.h>
      #include <cctype>
      #include <cerrno>
      #include <clocale>
      #include <cmath>
      #include <complex>
      #include <cstdio>
      #include <cstdlib>
      #include <cstring>
      #include <ctime>
      #include <deque>
      #include <exception>
      #include <fstream>
      #include <functional>
      #include <limits>
      #include <list>
      #include <map>
      #include <iomanip>
      #include <ios>
      #include <iosfwd>
      #include <iostream>
      #include <istream>
      #include <ostream>
      #include <queue>
      #include <set>
      #include <sstream>
      #include <stack>
      #include <stdexcept>
      #include <streambuf>
      #include <string>
      #include <utility>
      #include <vector>
      #include <cwchar>
      #include <cwctype>
      #include <complex.h>
      #include <fenv.h>
      #include <inttypes.h>
      #include <stdbool.h>
      #include <stdint.h>
      #include <tgmath.h>
      #include <algorithm>
      #include <stdio.h>
      #include <bitset>
      #include <string.h>
      #include <math.h>
      #include <cctype>
      #include <cerrno>
      #include <clocale>
      #include <cmath>
      #include <complex>
      #include <cstdio>
      #include <cstdlib>
      #include <cstring>
      #include <ctime>
      #include <deque>
      #include <exception>
      #include <fstream>
      #include <functional>
      #include <limits>
      #include <list>
      #include <map>
      #include <iomanip>
      #include <ios>
      #include <iosfwd>
      #include <iostream>
      #include <istream>
      #include <ostream>
      #include <queue>
      #include <set>
      #include <sstream>
      #include <stack>
      #include <stdexcept>
      #include <streambuf>
      #include <string>
      #include <utility>
      #include <vector>
      #include <cwchar>
      #include <cwctype>
      #include <complex.h>
      #include <fenv.h>
      #include <inttypes.h>
      #include <stdbool.h>
      #include <stdint.h>
      #include <tgmath.h>
      #include <algorithm>
      #include <stdio.h>
      #include <bitset>
      #include <string.h>
      #include <math.h>
      #include <cctype>
      #include <cerrno>
      #include <clocale>
      #include <cmath>
      #include <complex>
      #include <cstdio>
      #include <cstdlib>
      #include <cstring>
      #include <ctime>
      #include <deque>
      #include <exception>
      #include <fstream>
      #include <functional>
      #include <limits>
      #include <list>
      #include <map>
      #include <iomanip>
      #include <ios>
      #include <iosfwd>
      #include <iostream>
      #include <istream>
      #include <ostream>
      #include <queue>
      #include <set>
      #include <sstream>
      #include <stack>
      #include <stdexcept>
      #include <streambuf>
      #include <string>
      #include <utility>
      #include <vector>
      #include <cwchar>
      #include <cwctype>
      #include <complex.h>
      #include <fenv.h>
      #include <inttypes.h>
      #include <stdbool.h>
      #include <stdint.h>
      #include <tgmath.h>
      #include <algorithm>
      #include <stdio.h>
      #include <bitset>
      #include <string.h>
      #include <math.h>
      #include <cctype>
      #include <cerrno>
      #include <clocale>
      #include <cmath>
      #include <complex>
      #include <cstdio>
      #include <cstdlib>
      #include <cstring>
      #include <ctime>
      #include <deque>
      #include <exception>
      #include <fstream>
      #include <functional>
      #include <limits>
      #include <list>
      #include <map>
      #include <iomanip>
      #include <ios>
      #include <iosfwd>
      #include <iostream>
      #include <istream>
      #include <ostream>
      #include <queue>
      #include <set>
      #include <sstream>
      #include <stack>
      #include <stdexcept>
      #include <streambuf>
      #include <string>
      #include <utility>
      #include <vector>
      #include <cwchar>
      #include <cwctype>
      #include <complex.h>
      #include <fenv.h>
      #include <inttypes.h>
      #include <stdbool.h>
      #include <stdint.h>
      #include <tgmath.h>
      #include <algorithm>
      #include <stdio.h>
      #include <bitset>
      #include <string.h>
      #include <math.h>
      #include <cctype>
      #include <cerrno>
      #include <clocale>
      #include <cmath>
      #include <complex>
      #include <cstdio>
      #include <cstdlib>
      #include <cstring>
      #include <ctime>
      #include <deque>
      #include <exception>
      #include <fstream>
      #include <functional>
      #include <limits>
      #include <list>
      #include <map>
      #include <iomanip>
      #include <ios>
      #include <iosfwd>
      #include <iostream>
      #include <istream>
      #include <ostream>
      #include <queue>
      #include <set>
      #include <sstream>
      #include <stack>
      #include <stdexcept>
      #include <streambuf>
      #include <string>
      #include <utility>
      #include <vector>
      #include <cwchar>
      #include <cwctype>
      #include <complex.h>
      #include <fenv.h>
      #include <inttypes.h>
      #include <stdbool.h>
      #include <stdint.h>
      #include <tgmath.h>
      #include <algorithm>
      #include <stdio.h>
      #include <bitset>
      #include <string.h>
      #include <math.h>
      #include <cctype>
      #include <cerrno>
      #include <clocale>
      #include <cmath>
      #include <complex>
      #include <cstdio>
      #include <cstdlib>
      #include <cstring>
      #include <ctime>
      #include <deque>
      #include <exception>
      #include <fstream>
      #include <functional>
      #include <limits>
      #include <list>
      #include <map>
      #include <iomanip>
      #include <ios>
      #include <iosfwd>
      #include <iostream>
      #include <istream>
      #include <ostream>
      #include <queue>
      #include <set>
      #include <sstream>
      #include <stack>
      #include <stdexcept>
      #include <streambuf>
      #include <string>
      #include <utility>
      #include <vector>
      #include <cwchar>
      #include <cwctype>
      #include <complex.h>
      #include <fenv.h>
      #include <inttypes.h>
      #include <stdbool.h>
      #include <stdint.h>
      #include <tgmath.h>
      #include <algorithm>
      #include <stdio.h>
      #include <bitset>
      #include <string.h>
      #include <math.h>
      #include <cctype>
      #include <cerrno>
      #include <clocale>
      #include <cmath>
      #include <complex>
      #include <cstdio>
      #include <cstdlib>
      #include <cstring>
      #include <ctime>
      #include <deque>
      #include <exception>
      #include <fstream>
      #include <functional>
      #include <limits>
      #include <list>
      #include <map>
      #include <iomanip>
      #include <ios>
      #include <iosfwd>
      #include <iostream>
      #include <istream>
      #include <ostream>
      #include <queue>
      #include <set>
      #include <sstream>
      #include <stack>
      #include <stdexcept>
      #include <streambuf>
      #include <string>
      #include <utility>
      #include <vector>
      #include <cwchar>
      #include <cwctype>
      #include <complex.h>
      #include <fenv.h>
      #include <inttypes.h>
      #include <stdbool.h>
      #include <stdint.h>
      #include <tgmath.h>
      #include <algorithm>
      #include <stdio.h>
      #include <bitset>
      #include <string.h>
      #include <math.h>
      #include <cctype>
      #include <cerrno>
      #include <clocale>
      #include <cmath>
      #include <complex>
      #include <cstdio>
      #include <cstdlib>
      #include <cstring>
      #include <ctime>
      #include <deque>
      #include <exception>
      #include <fstream>
      #include <functional>
      #include <limits>
      #include <list>
      #include <map>
      #include <iomanip>
      #include <ios>
      #include <iosfwd>
      #include <iostream>
      #include <istream>
      #include <ostream>
      #include <queue>
      #include <set>
      #include <sstream>
      #include <stack>
      #include <stdexcept>
      #include <streambuf>
      #include <string>
      #include <utility>
      #include <vector>
      #include <cwchar>
      #include <cwctype>
      #include <complex.h>
      #include <fenv.h>
      #include <inttypes.h>
      #include <stdbool.h>
      #include <stdint.h>
      #include <tgmath.h>
      #include <algorithm>
      #include <stdio.h>
      #include <bitset>
      #include <string.h>
      #include <math.h>
      #include <cctype>
      #include <cerrno>
      #include <clocale>
      #include <cmath>
      #include <complex>
      #include <cstdio>
      #include <cstdlib>
      #include <cstring>
      #include <ctime>
      #include <deque>
      #include <exception>
      #include <fstream>
      #include <functional>
      #include <limits>
      #include <list>
      #include <map>
      #include <iomanip>
      #include <ios>
      #include <iosfwd>
      #include <iostream>
      #include <istream>
      #include <ostream>
      #include <queue>
      #include <set>
      #include <sstream>
      #include <stack>
      #include <stdexcept>
      #include <streambuf>
      #include <string>
      #include <utility>
      #include <vector>
      #include <cwchar>
      #include <cwctype>
      #include <complex.h>
      #include <fenv.h>
      #include <inttypes.h>
      #include <stdbool.h>
      #include <stdint.h>
      #include <tgmath.h>
      #include <algorithm>
      #include <stdio.h>
      #include <bitset>
      #include <string.h>
      #include <math.h>
      #include <cctype>
      #include <cerrno>
      #include <clocale>
      #include <cmath>
      #include <complex>
      #include <cstdio>
      #include <cstdlib>
      #include <cstring>
      #include <ctime>
      #include <deque>
      #include <exception>
      #include <fstream>
      #include <functional>
      #include <limits>
      #include <list>
      #include <map>
      #include <iomanip>
      #include <ios>
      #include <iosfwd>
      #include <iostream>
      #include <istream>
      #include <ostream>
      #include <queue>
      #include <set>
      #include <sstream>
      #include <stack>
      #include <stdexcept>
      #include <streambuf>
      #include <string>
      #include <utility>
      #include <vector>
      #include <cwchar>
      #include <cwctype>
      #include <complex.h>
      #include <fenv.h>
      #include <inttypes.h>
      #include <stdbool.h>
      #include <stdint.h>
      #include <tgmath.h>
      #include <algorithm>
      #include <stdio.h>
      #include <bitset>
      #include <string.h>
      #include <math.h>
      #include <cctype>
      #include <cerrno>
      #include <clocale>
      #include <cmath>
      #include <complex>
      #include <cstdio>
      #include <cstdlib>
      #include <cstring>
      #include <ctime>
      #include <deque>
      #include <exception>
      #include <fstream>
      #include <functional>
      #include <limits>
      #include <list>
      #include <map>
      #include <iomanip>
      #include <ios>
      #include <iosfwd>
      #include <iostream>
      #include <istream>
      #include <ostream>
      #include <queue>
      #include <set>
      #include <sstream>
      #include <stack>
      #include <stdexcept>
      #include <streambuf>
      #include <string>
      #include <utility>
      #include <vector>
      #include <cwchar>
      #include <cwctype>
      #include <complex.h>
      #include <fenv.h>
      #include <inttypes.h>
      #include <stdbool.h>
      #include <stdint.h>
      #include <tgmath.h>
      #include <algorithm>
      #include <stdio.h>
      #include <bitset>
      #include <string.h>
      #include <math.h>
      #include <cctype>
      #include <cerrno>
      #include <clocale>
      #include <cmath>
      #include <complex>
      #include <cstdio>
      #include <cstdlib>
      #include <cstring>
      #include <ctime>
      #include <deque>
      #include <exception>
      #include <fstream>
      #include <functional>
      #include <limits>
      #include <list>
      #include <map>
      #include <iomanip>
      #include <ios>
      #include <iosfwd>
      #include <iostream>
      #include <istream>
      #include <ostream>
      #include <queue>
      #include <set>
      #include <sstream>
      #include <stack>
      #include <stdexcept>
      #include <streambuf>
      #include <string>
      #include <utility>
      #include <vector>
      #include <cwchar>
      #include <cwctype>
      #include <complex.h>
      #include <fenv.h>
      #include <inttypes.h>
      #include <stdbool.h>
      #include <stdint.h>
      #include <tgmath.h>
      #include <algorithm>
      #include <stdio.h>
      #include <bitset>
      #include <string.h>
      #include <math.h>
      #include <cctype>
      #include <cerrno>
      #include <clocale>
      #include <cmath>
      #include <complex>
      #include <cstdio>
      #include <cstdlib>
      #include <cstring>
      #include <ctime>
      #include <deque>
      #include <exception>
      #include <fstream>
      #include <functional>
      #include <limits>
      #include <list>
      #include <map>
      #include <iomanip>
      #include <ios>
      #include <iosfwd>
      #include <iostream>
      #include <istream>
      #include <ostream>
      #include <queue>
      #include <set>
      #include <sstream>
      #include <stack>
      #include <stdexcept>
      #include <streambuf>
      #include <string>
      #include <utility>
      #include <vector>
      #include <cwchar>
      #include <cwctype>
      #include <complex.h>
      #include <fenv.h>
      #include <inttypes.h>
      #include <stdbool.h>
      #include <stdint.h>
      #include <tgmath.h>
      #include <algorithm>
      #include <stdio.h>
      #include <bitset>
      #include <string.h>
      #include <math.h>
      #include <cctype>
      #include <cerrno>
      #include <clocale>
      #include <cmath>
      #include <complex>
      #include <cstdio>
      #include <cstdlib>
      #include <cstring>
      #include <ctime>
      #include <deque>
      #include <exception>
      #include <fstream>
      #include <functional>
      #include <limits>
      #include <list>
      #include <map>
      #include <iomanip>
      #include <ios>
      #include <iosfwd>
      #include <iostream>
      #include <istream>
      #include <ostream>
      #include <queue>
      #include <set>
      #include <sstream>
      #include <stack>
      #include <stdexcept>
      #include <streambuf>
      #include <string>
      #include <utility>
      #include <vector>
      #include <cwchar>
      #include <cwctype>
      #include <complex.h>
      #include <fenv.h>
      #include <inttypes.h>
      #include <stdbool.h>
      #include <stdint.h>
      #include <tgmath.h>
      #include <algorithm>
      #include <stdio.h>
      #include <bitset>
      #include <string.h>
      #include <math.h>
      #include <cctype>
      #include <cerrno>
      #include <clocale>
      #include <cmath>
      #include <complex>
      #include <cstdio>
      #include <cstdlib>
      #include <cstring>
      #include <ctime>
      #include <deque>
      #include <exception>
      #include <fstream>
      #include <functional>
      #include <limits>
      #include <list>
      #include <map>
      #include <iomanip>
      #include <ios>
      #include <iosfwd>
      #include <iostream>
      #include <istream>
      #include <ostream>
      #include <queue>
      #include <set>
      #include <sstream>
      #include <stack>
      #include <stdexcept>
      #include <streambuf>
      #include <string>
      #include <utility>
      #include <vector>
      #include <cwchar>
      #include <cwctype>
      #include <complex.h>
      #include <fenv.h>
      #include <inttypes.h>
      #include <stdbool.h>
      #include <stdint.h>
      #include <tgmath.h>
      #include <algorithm>
      #include <stdio.h>
      #include <bitset>
      #include <string.h>
      #include <math.h>
      #include <cctype>
      #include <cerrno>
      #include <clocale>
      #include <cmath>
      #include <complex>
      #include <cstdio>
      #include <cstdlib>
      #include <cstring>
      #include <ctime>
      #include <deque>
      #include <exception>
      #include <fstream>
      #include <functional>
      #include <limits>
      #include <list>
      #include <map>
      #include <iomanip>
      #include <ios>
      #include <iosfwd>
      #include <iostream>
      #include <istream>
      #include <ostream>
      #include <queue>
      #include <set>
      #include <sstream>
      #include <stack>
      #include <stdexcept>
      #include <streambuf>
      #include <string>
      #include <utility>
      #include <vector>
      #include <cwchar>
      #include <cwctype>
      #include <complex.h>
      #include <fenv.h>
      #include <inttypes.h>
      #include <stdbool.h>
      #include <stdint.h>
      #include <tgmath.h>
      #include <algorithm>
      #include <stdio.h>
      #include <bitset>
      #include <string.h>
      #include <math.h>
      #include <cctype>
      #include <cerrno>
      #include <clocale>
      #include <cmath>
      #include <complex>
      #include <cstdio>
      #include <cstdlib>
      #include <cstring>
      #include <ctime>
      #include <deque>
      #include <exception>
      #include <fstream>
      #include <functional>
      #include <limits>
      #include <list>
      #include <map>
      #include <iomanip>
      #include <ios>
      #include <iosfwd>
      #include <iostream>
      #include <istream>
      #include <ostream>
      #include <queue>
      #include <set>
      #include <sstream>
      #include <stack>
      #include <stdexcept>
      #include <streambuf>
      #include <string>
      #include <utility>
      #include <vector>
      #include <cwchar>
      #include <cwctype>
      #include <complex.h>
      #include <fenv.h>
      #include <inttypes.h>
      #include <stdbool.h>
      #include <stdint.h>
      #include <tgmath.h>
      const int N=1e6+10;
      const int INF=0x3f3f3f3f;
      using namespace std;
      int nimade,miaolegemi;
      bool raopeihang[1000];
      int main(){
      	cin>>nimade>>miaolegemi;
      	for(int fuck=0,Minecraft;fuck<miaolegemi;fuck++){
      		cin>>Minecraft;
      		raopeihang[Minecraft]=1; 
      	}
      	bool SB=1;
      	for(int fuck=0;fuck<nimade;fuck++)
      		if (!raopeihang[fuck]){
      			SB=0;
      			cout<<fuck<<" ";
      		}
      	if(SB)cout<<nimade;
      	return 0;
      }
      
      
      
      • 1
        @ 2025-11-5 19:24:02

        #include<bits/stdc++.h> using namespace std; int main() { int l,t; cin>>l>>t; int nums[l+1]={0}; int low,hight; for(int i=0;i<t;i++) { cin>>low>>hight; for(int j=low;j<=hight;j++) { nums[j]=1; } } int sum=0; for(int i=0;i<l+1;i++) { if(nums[i]==0) { sum++; } } cout<<sum; }

        • 1
          @ 2025-11-5 19:22:56

          #include<bits/stdc++.h> using namespace std; int main() { int l,t; cin>>l>>t; int nums[l+1]={0}; int low,hight; for(int i=0;i<t;i++) { cin>>low>>hight; for(int j=low;j<=hight;j++) { nums[j]=1; } } int sum=0; for(int i=0;i<l+1;i++) { if(nums[i]==0) { sum++; } } cout<<sum; }

          • 1
            @ 2025-11-5 19:22:25
            #include<bits/stdc++.h>
            using namespace std;
            const int N=1e5+5;
            int main(){
            	int n,m;
            	cin>>n>>m;
            	int nums[n]={0};
            	for(int i=0;i<m;i++){
            		int t;
            		cin>>t;
            		nums[t]=1;
            	}
            	int cnt=0;
            	for(int i=0;i<n;i++){
            		if(nums[i]==1)cnt++;
            	}
            	if(cnt==n)cout<<n<<endl;
            	else{
            		for(int i=0;i<n;i++)
            		if(nums[i]==0)cout<<i<<" ";
            	}
            	return 0;
            }
            • 1

            信息

            ID
            3302
            时间
            1000ms
            内存
            256MiB
            难度
            7
            标签
            递交数
            111
            已通过
            28
            上传者