PERMUT2 - Ambiguous Permutations

题意翻译

## 题目描述 一些编程比赛是非常棘手的:它们不仅要求与你期望不一样的输出格式,样例输出也没有体现出差异。举一个例子,让我们看一下排列组合。 一个 $1$ 到 $n$ 的**排列**是这些数字的一个组合。所以表达一个排列的自然方式就是按此顺序列出整数。在 $n=5$ 的情况下,一个排列可能像 $2,3,4,5,1$。 然而,有另一种表达排列的可能:你依次输出数字 $i$ 的位置。我们将第二种可能称作**翻转排列**。上面排列的翻转排列是 $5,1,2,3,4$。 一个**模糊排列**是指无法与它的翻转排列区分开来的排列。举个例子,排列 $1,4,3,2$ 就是模糊的,因为它与它的翻转排列是一样的。为了摆脱这些烦人的样例,你需要写一个能够检测出序列是否模糊的程序。 ## 输入格式 **输入包含多组数据**。 每组数据的第一行包含一个整数 $n$ $(1 \le n \le 100000)$。下一行是一个 $1$ 至 $n$ 的排列。相邻的数字之间有一个空格。保证排列中 $1$ 至 $n$ 的整数每个仅出现一次。 最后一组数据后用 $0$ 结束。 ## 输出格式 对于每组测试数据,输出排列是否模糊。请遵守样例中的格式。 ## 输入输出样例 ### 输入#1 ``` 4 1 4 3 2 5 2 3 4 5 1 1 1 0 ``` ### 输出#1 ``` ambiguous not ambiguous ambiguous ```

题目描述

Some programming contest problems are really tricky: not only do they require a different output format from what you might have expected, but also the sample output does not show the difference. For an example, let us look at permutations. A **permutation** of the integers _1_ to _n_ is an ordering of these integers. So the natural way to represent a permutation is to list the integers in this order. With _n = 5_, a permutation might look like 2, 3, 4, 5, 1. However, there is another possibility of representing a permutation: You create a list of numbers where the _i_-th number is the position of the integer _i_ in the permutation. Let us call this second possibility an **inverse permutation**. The inverse permutation for the sequence above is 5, 1, 2, 3, 4. An **ambiguous permutation** is a permutation which cannot be distinguished from its inverse permutation. The permutation 1, 4, 3, 2 for example is ambiguous, because its inverse permutation is the same. To get rid of such annoying sample test cases, you have to write a program which detects if a given permutation is ambiguous or not.

输入输出格式

输入格式


输出格式


输入输出样例

暂无测试点