3393: [初级] 号码牌

Memory Limit:128 MB Time Limit:1.000 S
Submit数:2 Solved数:2

Description

张老师班上有 lns="http://www.w3.org/1998/Math/MathML">N 位同学参加秋季运动会,老师为同学们定制了比赛专属号码牌,编号为 lns="http://www.w3.org/1998/Math/MathML">1 \sim N

生产号码牌的商家发货后,张老师发现号码牌少了 lns="http://www.w3.org/1998/Math/MathML">1 个号码,但是统计后发现,确实有 lns="http://www.w3.org/1998/Math/MathML">N 个号码牌,且所有号码牌的编号都在 lns="http://www.w3.org/1998/Math/MathML">[1,N] 的范围内,但是有一个号码被错误的印刷成了另一个号码。

请编程帮老师找出这些号码牌中,缺失的号码和被错误印刷了 lns="http://www.w3.org/1998/Math/MathML">2 次的号码。

数据范围

对于 lns="http://www.w3.org/1998/Math/MathML">30\% 的测试数据,满足 lns="http://www.w3.org/1998/Math/MathML">5 \le N \le 30

对于 lns="http://www.w3.org/1998/Math/MathML">70\% 的测试数据,满足 lns="http://www.w3.org/1998/Math/MathML">5 \le N \le 10000

对于 lns="http://www.w3.org/1998/Math/MathML">100\% 的测试数据,满足 lns="http://www.w3.org/1998/Math/MathML">5 \le N \le 100000

所有测试点均满足读入的 lns="http://www.w3.org/1998/Math/MathML">N 个号码牌的数值均在 lns="http://www.w3.org/1998/Math/MathML">[1,N] 的范围内,且缺失的号码牌及被错误印刷 lns="http://www.w3.org/1998/Math/MathML">2 次的号码牌均是唯一的。

Input描述

第 lns="http://www.w3.org/1998/Math/MathML">1 行读入整数 lns="http://www.w3.org/1998/Math/MathML">N,代表号码牌的数量;

第 lns="http://www.w3.org/1998/Math/MathML">2 行读入 lns="http://www.w3.org/1998/Math/MathML">N 个号码,用空格隔开。

Output描述

输出 lns="http://www.w3.org/1998/Math/MathML">2 个整数,用空格隔开,第 lns="http://www.w3.org/1998/Math/MathML">1 个整数,代表缺失的号码,第 lns="http://www.w3.org/1998/Math/MathML">2 个整数代表被印刷了 lns="http://www.w3.org/1998/Math/MathML">2 次的号码。

Sample Input Copy

6
2 1 5 2 4 6

Sample Output Copy

3 2

Source/Category

Problem :   3393        Language:        




    # 输入数据自测: