首页 > 学院 > 开发设计 > 正文

1041. Be Unique (20)

2019-11-11 05:44:50
字体:
来源:转载
供稿:网友
#include<iostream>#include<algorithm>#include<vector>#include<map> #include<string>#include<set>using namespace std;const int N = 10010;int num[N] = {0}; vector<int> all_num;int main(){	int n ;	cin>>n;	for(int i = 0; i < n; i++){		int temp;		scanf("%d",&temp);		num[temp]++;		all_num.push_back(temp);	}	for(int i = 0; i < n; i++){		if(num[all_num[i]] == 1){			cout<<all_num[i];			return 0;		}	}	cout<<"None";	return 0;}
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表