5 solutions

  • 1
    @ 2024-12-4 16:37:49
    #include<bits/stdc++.h>
    using namespace std;
    long long n, m, x = 0;
    int main()
    {
    	cin >> n;
    	for(int i = 1;i <= n;i++)
    	{
    		cin >> m;
    		x^=m;
    	}
    	cout << x;
    	return 0;
    }
    
    • 0
      @ 2024-12-9 15:58:03
      #include<iostream>
      #include<queue>
      #include<stack>
      #include<cmath>
      #include<algorithm>
      #include<cstring>
      using namespace std; 
      long long n[100000];
      int main ()
      {
          int a,b,c=0;//C要清零!!!!
      	cin>>a;//输入不用教吧?啊?
          while(a--)
          {
      		cin>>b;
              c^=b;//对其进行位运算操作
          }
      //    int i=0;
      //    while(n[i]%2!=1)
      //    {
      //    	i++;
      //	}
      	cout<<c;
          return 0;
      }
      

      不要抄哦!!!(0-0 )

      • 0
        @ 2024-12-6 19:01:16
        
        #include<bits/stdc++.h>
        
        using namespace std;
        map<int,int> mp;
        int n,x;
        int main(){
        	cin>>n;
        	for(int i=1;i<=n;i++){
        		cin>>x;
        		mp[x]++;
        	}
        	for(auto x:mp){
        		if(x.second%2!=0)cout<<x.first;
        	}
        	return 0;
          //this is so (two B),if you see,you
          //are (two B) too.
          //you shouldn't running this 程序 in
          //Dev.C++
        }
        
        • -1
          @ 2024-12-6 21:48:41
          ```cpp
          #include<bits/stdc++.h>
          using namespace std;
          
          int main(){
              int n;
              cin>>n;
              int x=0;
              for(int i=1;i<=n;i++){
                  int s;
                  cin>>s;
                  x^=s;
              }
              cout<<x;
              return 0;
          }
          
          • -1
            @ 2024-12-4 22:24:59
            #include<queue>
            #include<stack>
            #include<cmath>
            #include<algorithm>
            #include<cstring>
            using namespace std; 
            int n[1000];
            int main ()
            {
                int a,b;
            	cin>>a;
                while(a--)
                {
            		cin>>b;
                    n[b-1]++;
                }
                int i=0;
                while(1)
                {
                	if(n[i]%2==1)
                	{
                		cout<<i+1;
                		break;
            		}
                	i++;
            	}
                return 0;
            }
            

            不要抄哦(o-o )

            • 1

            Information

            ID
            1142
            Time
            1000ms
            Memory
            1MiB
            Difficulty
            5
            Tags
            (None)
            # Submissions
            68
            Accepted
            27
            Uploaded By