PAT (Advanced Level) 1041. Be Unique (20)
简单题。
#include<cstdio>
#include<cstring>
#include<cmath>
#include<vector>
#include<map>
#include<queue>
#include<stack>
#include<string>
#include<algorithm>
using namespace std; int n;
int a[+];
int f[+]; int main()
{
memset(f,,sizeof f);
scanf("%d",&n);
for(int i=;i<=n;i++) scanf("%d",&a[i]);
for(int i=;i<=n;i++) f[a[i]]++;
int fail=;
for(int i=;i<=n;i++)
{
if(f[a[i]]==)
{
fail=;
printf("%d\n",a[i]);
break;
}
}
if(fail==) printf("None\n");
return ;
}
PAT (Advanced Level) 1041. Be Unique (20)的更多相关文章
- PAT (Advanced Level) Practice 1035 Password (20 分) 凌宸1642
PAT (Advanced Level) Practice 1035 Password (20 分) 凌宸1642 题目描述: To prepare for PAT, the judge someti ...
- PAT (Advanced Level) Practice 1008 Elevator (20 分) 凌宸1642
PAT (Advanced Level) Practice 1008 Elevator (20 分) 凌宸1642 题目描述: The highest building in our city has ...
- PTA(Advanced Level)1041.Be Unique
Being unique is so important to people on Mars that even their lottery is designed in a unique way. ...
- PAT (Advanced Level) Practice 1035 Password (20 分)
To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem ...
- 【PAT Advanced Level】1008. Elevator (20)
没什么难的,简单模拟题 #include <iostream> using namespace std; int main() { int num; cin>>num; int ...
- PAT (Advanced Level) 1112. Stucked Keyboard (20)
找出一定没问题的字符(即一连串的额字符x个数能被k整除的),剩下的字符都是可能有问题的. #include<cstdio> #include<cstring> #include ...
- PAT (Advanced Level) 1108. Finding Average (20)
简单模拟. #include<cstdio> #include<cstring> #include<cmath> #include<vector> #i ...
- PAT (Advanced Level) 1100. Mars Numbers (20)
简单题. #include<cstdio> #include<cstring> #include<cmath> #include<vector> #in ...
- PAT (Advanced Level) 1096. Consecutive Factors (20)
如果是素数直接输出1与素数,否则枚举长度和起始数即可. #include<cstdio> #include<cstring> #include<cmath> #in ...
随机推荐
- hdu_3067_小t的游戏(脑洞)
题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=3067 题意:中文,不解释 题解:一看就知道是要找规律的题,都是有循环节的,看代码. #include ...
- 裸二分图匹配poj1469
poj1496 题意: 给你p门课程和n个学生,一个学生可以选0门,1门,或者多门课程, 现在要求一个由p个学生组成的集合,满足下列2个条件: 1.每个学生选择一个不同的课程 2.每个课程都有不同的代 ...
- 错误: libstdc++.so.6: cannot open shared object file: No such file or directory
解压完别人提供的openwrt代码,编译时,出现如下错误: # configuration written to .config#mips-openwrt-linux-uclibc-gcc: erro ...
- a/b + c/d
a/b + c/d Time Limit : 1000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other) Total Sub ...
- 【python问题系列--1】SyntaxError:Non-ASCII character '\xe5' in file kNN.py on line 2, but no encoding declared;
因为Python在默认状态下不支持源文件中的编码所致.解决方案有如下三种: 一.在文件头部添加如下注释码: # coding=<encoding name> 例如,可添加# coding= ...
- 今天遇到了隐藏顶部菜单栏(top bar)的菜鸟问题,解决了。
self.navigationController.navigationBarHidden = YES; http://stackoverflow.com/questions/3397381/hide ...
- sqlserver低版本生成插入脚本
--将表数据生成SQL脚本的存储过程 CREATE PROCEDURE dbo.UspOutputData @tablename sysname AS declare @column varchar( ...
- 关于PHP执行超时的问题
PHP配置文件的参数max_execution_time表示脚本执行超时时间 max_execution_time=0表示不限制 max_execution_time=2表示执行两秒后终止,同时报错F ...
- QProcess 进程类—调用外部程序
http://blog.csdn.net/newbee520/article/details/8279101 启动一个新的进程的操作非常简单,只需要将待启动的程序名称和启动参数传递给start() ...
- IOS中Label根据上个label的内容设置下个label的frame
#import "ViewController.h" @interface ViewController () @property(nonatomic,strong)UILabel ...