CF769A.Year of University Entrance

入门

通过率:0%

时间限制:1.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

There is the faculty of Computer Science in Berland. In the social net "TheContact!" for each course of this faculty there is the special group whose name equals the year of university entrance of corresponding course of students at the university.

Each of students joins the group of his course and joins all groups for which the year of student's university entrance differs by no more than x from the year of university entrance of this student, where x — some non-negative integer. A value x is not given, but it can be uniquely determined from the available data. Note that students don't join other groups.

You are given the list of groups which the student Igor joined. According to this information you need to determine the year of Igor's university entrance.

伯兰德有一所计算机科学学院。在社交网络“TheContact!”中,该学院的每一届学生都拥有一个特殊的群组,群组名称等于该届学生进入大学的年份。

每位学生会加入自己所在届的群组,并且还会加入所有满足以下条件的群组:该群组对应的入学年份与该学生自己的入学年份之差的绝对值不超过某个非负整数 xx(即 ∣群组年份−学生入学年份∣≤x| \text{群组年份} - \text{学生入学年份} | \le x)。该值 xx 并未直接给出,但可根据已知数据唯一确定。注意:学生不会加入其他任何群组。

现给出学生伊戈尔(Igor)所加入的群组列表。根据这一信息,你需要确定伊戈尔进入大学的年份。

输入格式

The first line contains the positive odd integer n (1 ≤ n ≤ 5) — the number of groups which Igor joined.

The next line contains n distinct integers _a_1, _a_2, ..., a__n (2010 ≤ a__i ≤ 2100) — years of student's university entrance for each group in which Igor is the member.

It is guaranteed that the input data is correct and the answer always exists. Groups are given randomly.

第一行包含一个正奇数 nn(1≤n≤51 \leq n \leq 5)—— Igor 所加入的小组数量。

下一行包含 nn 个互不相同的整数 a1, a2, ..., ana_1,\,a_2,\,...,\,a_n(2010≤ai≤21002010 \leq a_i \leq 2100)—— Igor 所在各小组中学生的大学入学年份。

保证输入数据合法,且答案一定存在。各小组按随机顺序给出。

输出格式

Print the year of Igor's university entrance.

打印伊戈尔进入大学的年份。

输入输出样例

  • 输入#1

    3
    2014 2016 2015

    输出#1

    2015
  • 输入#2

    1
    2050

    输出#2

    2050

说明/提示

In the first test the value x = 1. Igor entered the university in 2015. So he joined groups members of which are students who entered the university in 2014, 2015 and 2016.

In the second test the value x = 0. Igor entered only the group which corresponds to the year of his university entrance.

在第一个测试中,值 x=1x = 1。伊戈尔于 2015 年进入大学。因此,他加入了成员为 2014、2015 和 2016 年入学的大学生所组成的小组。

在第二个测试中,值 x=0x = 0。伊戈尔仅加入了与自己大学入学年份相对应的小组。

输入解题思路,AI测评打分。不知道怎么写?

首页