CF27B.Tournament
普及-
通过率:0%
时间限制:2.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
The tournament «Sleepyhead-2010» in the rapid falling asleep has just finished in Berland. n best participants from the country have participated in it. The tournament consists of games, each of them is a match between two participants. n·(n - 1) / 2 games were played during the tournament, and each participant had a match with each other participant.
The rules of the game are quite simple — the participant who falls asleep first wins. The secretary made a record of each game in the form «x__i y__i», where x__i and y__i are the numbers of participants. The first number in each pair is a winner (i.e. x__i is a winner and y__i is a loser). There is no draws.
Recently researches form the «Institute Of Sleep» have found that every person is characterized by a value p__j — the speed of falling asleep. The person who has lower speed wins. Every person has its own value p__j, constant during the life.
It is known that all participants of the tournament have distinct speeds of falling asleep. Also it was found that the secretary made records about all the games except one. You are to find the result of the missing game.
“瞌睡虫-2010”快速入睡锦标赛刚刚在伯兰德落幕。全国最优秀的 n 名选手参加了本次比赛。比赛由若干场对决组成,每场对决在两名选手之间进行。整个锦标赛共进行了 n⋅(n−1)/2 场比赛,即每位选手均与其他所有选手各比赛一次。
比赛规则非常简单:率先入睡者获胜。秘书以「xi yi」的形式记录了每场比赛结果,其中 xi 和 yi 分别为参赛选手的编号;每对数字中,第一个数为胜者(即 xi 获胜,yi 失败)。比赛中不存在平局。
近期,“睡眠研究所”的研究人员发现,每个人均具有一个特征值 pj —— 其入睡速度。入睡速度较低者获胜。每个人的 pj 值是其固有属性,终生恒定。
已知本次锦标赛所有参赛选手的入睡速度互不相同。此外还发现,秘书仅遗漏记录了一场比赛的结果。你需要推断出这场缺失比赛的结果。
输入格式
The first line contains one integer n (3 ≤ n ≤ 50) — the number of participants. The following n·(n - 1) / 2 - 1 lines contain the results of the games. Each game is described in a single line by two integers x__i, y__i (1 ≤ x__i, y__i ≤ n, x__i ≠ y__i), where x__i и y__i are the numbers of the opponents in this game. It is known that during the tournament each of the n participants played n - 1 games, one game with each other participant.
第一行包含一个整数 n(3≤n≤50)—— 参赛者人数。接下来的 2n⋅(n−1)−1 行描述了各场比赛的结果。每场比赛用一行中的两个整数 xi, yi(1≤xi, yi≤n,且 xi=yi)表示,其中 xi 和 yi 是该场比赛中两名参赛者的编号。已知在整个锦标赛中,n 名参赛者每人恰好进行了 n−1 场比赛,即每两名参赛者之间恰好进行一场比赛。
输出格式
Output two integers x and y — the missing record. If there are several solutions, output any of them.
输出两个整数 x 和 y —— 缺失的记录。如果存在多个解,输出其中任意一个即可。
输入输出样例
输入#1
4 4 2 4 1 2 3 2 1 3 1
输出#1
4 3
输入解题思路,AI测评打分。不知道怎么写?