CF807A.Is it rated?

入门

通过率:0%

时间限制:2.00s

内存限制:256MB

AC君温馨提醒

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

题目描述

Is it rated?

Here it is. The Ultimate Question of Competitive Programming, Codeforces, and Everything. And you are here to answer it.

Another Codeforces round has been conducted. No two participants have the same number of points. For each participant, from the top to the bottom of the standings, their rating before and after the round is known.

It's known that if at least one participant's rating has changed, then the round was rated for sure.

It's also known that if the round was rated and a participant with lower rating took a better place in the standings than a participant with higher rating, then at least one round participant's rating has changed.

In this problem, you should not make any other assumptions about the rating system.

Determine if the current round is rated, unrated, or it's impossible to determine whether it is rated of not.

它是否为正式评级轮次(rated)?

来了!这是关于编程竞赛、Codeforces 以及一切的终极问题。而你,就在这里给出答案。

又一场 Codeforces 比赛刚刚结束。所有参赛者的得分互不相同。对于每位参赛者,已知其在排行榜中从高到低排列时,本轮比赛前后的等级分(rating)。

已知:只要至少有一名参赛者的等级分发生了变化,则该轮比赛必定是正式评级轮次(rated)。

还已知:如果该轮比赛是正式评级轮次(rated),且某位等级分较低的参赛者在排行榜中的名次高于某位等级分较高的参赛者,则至少有一名参赛者的等级分必然发生变化。

本题中,你不应就等级分系统作出任何其他假设。

请判断:本轮比赛是 正式评级轮次(rated)、非正式评级轮次(unrated),还是 无法确定其是否为正式评级轮次。

输入格式

The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of round participants.

Each of the next n lines contains two integers a__i and b__i (1 ≤ a__i, b__i ≤ 4126) — the rating of the i-th participant before and after the round, respectively. The participants are listed in order from the top to the bottom of the standings.

第一行包含一个整数 nn(2≤n≤10002 \leq n \leq 1000)—— 表示参赛人数。

接下来的 nn 行,每行包含两个整数 aia_i 和 bib_i(1≤ai,bi≤41261 \leq a_i, b_i \leq 4126)—— 分别表示第 ii 位参赛者在本轮比赛前后的评分。参赛者按排行榜从上到下的顺序列出。

输出格式

If the round is rated for sure, print "rated". If the round is unrated for sure, print "unrated". If it's impossible to determine whether the round is rated or not, print "maybe".

如果可以确定该轮比赛是计分的,请输出 “rated”。
如果可以确定该轮比赛是不计分的,请输出 “unrated”。
如果无法确定该轮比赛是否计分,请输出 “maybe”。

输入输出样例

  • 输入#1

    6
    3060 3060
    2194 2194
    2876 2903
    2624 2624
    3007 2991
    2884 2884

    输出#1

    rated
  • 输入#2

    4
    1500 1500
    1300 1300
    1200 1200
    1400 1400

    输出#2

    unrated
  • 输入#3

    5
    3123 3123
    2777 2777
    2246 2246
    2246 2246
    1699 1699

    输出#3

    maybe

说明/提示

In the first example, the ratings of the participants in the third and fifth places have changed, therefore, the round was rated.

In the second example, no one's rating has changed, but the participant in the second place has lower rating than the participant in the fourth place. Therefore, if the round was rated, someone's rating would've changed for sure.

In the third example, no one's rating has changed, and the participants took places in non-increasing order of their rating. Therefore, it's impossible to determine whether the round is rated or not.

在第一个例子中,第三名和第五名参赛者的评分发生了变化,因此该轮比赛是“有评分的”(rated)。

在第二个例子中,没有任何人的评分发生变化,但第二名参赛者的评分低于第四名参赛者的评分。因此,如果该轮比赛是有评分的,那么必然会有某个人的评分发生变化。

在第三个例子中,没有任何人的评分发生变化,且参赛者按其评分的非递增顺序获得名次。因此,无法确定该轮比赛是否为有评分的。

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

首页