1041 Be Unique (20 分)【难度: 简单 / 知识点: 暴力】
作者:互联网
https://pintia.cn/problem-sets/994805342720868352/problems/994805444361437184
#include<bits/stdc++.h>
using namespace std;
const int N=1e5+10;
int a[N],n;
map<int,int>mp;
int main(void)
{
cin>>n;
for(int i=0;i<n;i++) cin>>a[i],mp[a[i]]++;
for(int i=0;i<n;i++)
{
if(mp[a[i]]==1)
{
cout<<a[i];
return 0;
}
}
cout<<"None";
return 0;
}
标签:知识点,1041,20,cn,int,1e5,mp,using 来源: https://blog.csdn.net/qq_46527915/article/details/120484229