题意:找出N个数中与其他数不同的一个……
#include <iostream>
#include <cmath>
#include <stdio.h>
#include <string>
#include <cstring>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <queue>
#include <iomanip>
#include <algorithm>
#include <memory.h>
using namespace std;
int main()
{
int N;
cin>>N;
while(N--)
{
int n;
int a=-1,b=-1;
int a1=0,b1=0;
cin>>n;
for(int i=0;i<n;i++)
{
int k;
cin>>k;
if(a==k||a==-1)a=k,a1++;
else b=k,b1++;
}
printf("%d\n",a1>b1?b:a);
}
return 0;
}