#include<iostream> #include<cstdio> #include<string> #include<cstring> #include<queue> #include<vector> #include<cmath> #include<iomanip> #include<algorithm> using namespace std; const int SIZE = 100000+5; int arrCount[SIZE]; int main() { int N,i,x; vector<int> v; memset(arrCount,0,sizeof(arrCount)); // cin>>N; scanf("%d",&N); for(i=0; i<N; i++) { scanf("%d",&x); // cin>>x; arrCount[x]++; v.push_back(x); } for(i=0; i<v.size(); i++) if(arrCount[v[i]] == 1) { cout<<v[i]<<endl; break; } if(i == v.size()) cout<<"None"<<endl; return 0; }
来源:https://www.cnblogs.com/yanhaiming/archive/2012/12/15/2819363.html