CF471B MUH and Important Things

题目描述

在圣彼得堡动物园的两只北极熊,Menshykov 和 Uslada,及基辅动物园的大象 Horace 的努力下,他们面临着一天的 $ n $ 个任务。每只动物都需完成其中的所有任务,并为每个任务评定了难度。他们决定按照任务的难度顺序来完成这些任务。但由于某些任务难度相同,因此任务的完成顺序可能会有所不同。 Menshykov、Uslada 和 Horace 请你设计各自的完成任务的计划。每个计划都需是一个序列,表示动物完成所有 $ n $ 个任务的顺序。同时,他们有一个特别的要求:每个计划必须与其他计划不同,因此需要形成三个不同的序列。你需要为他们找到这样的计划组合,若无法满足要求则需告知他们这不可能。

输入格式

输入的第一行为一个整数 $ n $($1 \le n \le 2000$),表示任务数量。第二行为 $ n $ 个整数 $ d_1, d_2, \ldots, d_n $($1 \le d_i \le 10^9$),表示每个任务的难度。

输出格式

如果可以设计出三个不同的计划,输出 "YES"。否则,输出 "NO"。当存在三个满足条件的计划时,在接下来的三行中分别输出每个计划中任务的完成顺序,每行输出 $ n $ 个整数。 若存在多种可能的解,你可以输出其中任意一种。 ## 数据范围 任务数量为 $1$ 到 $2000$,每个任务的难度范围是 $1$ 到 $10^9$。 **本翻译由 AI 自动生成**

说明/提示

It's time polar bears Menshykov and Uslada from the zoo of St. Petersburg and elephant Horace from the zoo of Kiev got down to business. In total, there are $ n $ tasks for the day and each animal should do each of these tasks. For each task, they have evaluated its difficulty. Also animals decided to do the tasks in order of their difficulty. Unfortunately, some tasks can have the same difficulty, so the order in which one can perform the tasks may vary. Menshykov, Uslada and Horace ask you to deal with this nuisance and come up with individual plans for each of them. The plan is a sequence describing the order in which an animal should do all the $ n $ tasks. Besides, each of them wants to have its own unique plan. Therefore three plans must form three different sequences. You are to find the required plans, or otherwise deliver the sad news to them by stating that it is impossible to come up with three distinct plans for the given tasks.