시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 128 MB | 95 | 56 | 50 | 64.103% |
Every permutation A = (a1, ..., an) of numbers 1, ..., n can be coded by a sequence B = (b1, ..., bn) in which bi equals the number of all aj such that (j < i & aj > ai), for i = 1, ..., n.
The sequence B = (0, 0, 1, 0, 2, 0, 4) is the code of the permutation A = (1, 5, 2, 6, 4, 7, 3).
Write a program that:
NIE
("no").The standard output should contain:
NIE
, if the sequence B is not a code of any permutation.7 0 0 1 0 2 0 4
1 5 2 6 4 7 3
4 0 2 0 0
NIE