标签:
#include<stdio.h>
#include<string.h>
int harsh[10066];
int arr[100066];
int main()
{
memset(harsh,0,sizeof(harsh));
memset(arr,0,sizeof(arr));
int n;
scanf("%d",&n);
for(int i=0 ; i<n ; ++i)
{
int tmp;
scanf("%d",&tmp);
arr[i]=tmp;
++harsh[tmp];
}
int tag=0;
for(int i=0 ; i<n ; ++i)
{
if(harsh[arr[i]]==1)
{
printf("%d\n",arr[i]);
tag=1;
break;
}
}
if(0==tag)
printf("None\n");
return 0;
}
PAT:1041. Be Unique (20) AC “段错误:可能是数组开的不够大”
标签:
原文地址:http://www.cnblogs.com/Evence/p/4309775.html