CF986B.Petr and Permutations

普及/提高-

通过率:0%

AC君温馨提醒

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

题目描述

Petr likes to come up with problems about randomly generated data. This time problem is about random permutation. He decided to generate a random permutation this way: he takes identity permutation of numbers from 11 to nn and then 3n3n times takes a random pair of different elements and swaps them. Alex envies Petr and tries to imitate him in all kind of things. Alex has also come up with a problem about random permutation. He generates a random permutation just like Petr but swaps elements 7n+17n+1 times instead of 3n3n times. Because it is more random, OK?!

You somehow get a test from one of these problems and now you want to know from which one.
Petr 喜欢想一些关于随机生成数据的问题。这次的问题是关于随机排列的。他决定用这种方法生成随机排列:他从 11nn 的数字中提取身份排列,然后在 3n3n 中随机提取一对不同的元素,并将它们互换。亚历克斯非常羡慕彼得,并试图在所有事情上模仿他。亚历克斯还想出了一个关于随机排列的问题。他生成了一个和彼得一样的随机排列,但他交换了 7n+17n+1 次元素,而不是 3n3n 次。因为这样随机性更大,好吗?

你从其中一个问题中得到了一个测试,现在你想知道是从哪个问题中得到的。

输入格式

In the first line of input there is one integer nn ( 103n10610^{3} \le n \le 10^{6} ).

In the second line there are nn distinct integers between 11 and nn — the permutation of size nn from the test.

It is guaranteed that all tests except for sample are generated this way: First we choose nn — the size of the permutation. Then we randomly choose a method to generate a permutation — the one of Petr or the one of Alex. Then we generate a permutation using chosen method.
输入

在第一行输入中有一个整数 nn ( 103n10610^{3} \le n \le 10^{6} )。

第二行中有 nn 个介于 11nn 之间的不同整数,即来自测试的大小为 nn 的排列。

可以保证除了样本之外的所有测试都是这样产生的:首先,我们选择 nn --大小为 nn 的排列。然后,我们随机选择一种方法来生成 permutation - Petr 的方法或 Alex 的方法。然后使用所选方法生成一个排列。

输出格式

If the test is generated via Petr's method print "Petr" (without quotes). If the test is generated via Alex's method print "Um_nik" (without quotes).
输出

如果测试是通过 Petr 的方法生成的,则打印 "Petr"(不带引号)。如果测试是通过 Alex 的方法生成的,则打印 "Um_nik"(不带引号)。

输入输出样例

  • 输入#1

    5
    2 4 5 1 3
    

    输出#1

    Petr
    

说明/提示

Please note that the sample is not a valid test (because of limitations for nn ) and is given only to illustrate input/output format. Your program still has to print correct answer to this test to get AC.

Due to randomness of input hacks in this problem are forbidden.
备注

请注意,该示例并非有效测试(由于 nn 的限制),仅用于说明输入/输出格式。您的程序仍需打印该测试的正确答案,以获得 AC。

由于输入的随机性,禁止在此问题中使用黑客技术。

首页