結果

問題 No.2732 Similar Permutations
ユーザー 👑 rin204rin204
提出日時 2024-04-20 01:31:10
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,728 bytes
コンパイル時間 402 ms
コンパイル使用メモリ 82,392 KB
実行使用メモリ 116,220 KB
最終ジャッジ日時 2024-04-20 01:31:37
合計ジャッジ時間 23,256 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
52,480 KB
testcase_01 AC 38 ms
52,224 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 71 ms
82,304 KB
testcase_05 AC 65 ms
80,128 KB
testcase_06 AC 58 ms
70,160 KB
testcase_07 AC 99 ms
92,324 KB
testcase_08 AC 75 ms
83,504 KB
testcase_09 AC 66 ms
75,520 KB
testcase_10 AC 150 ms
113,408 KB
testcase_11 AC 57 ms
72,448 KB
testcase_12 AC 147 ms
113,152 KB
testcase_13 AC 151 ms
113,168 KB
testcase_14 AC 140 ms
113,224 KB
testcase_15 WA -
testcase_16 AC 123 ms
104,620 KB
testcase_17 AC 125 ms
104,680 KB
testcase_18 WA -
testcase_19 AC 148 ms
113,264 KB
testcase_20 AC 137 ms
113,012 KB
testcase_21 AC 141 ms
113,168 KB
testcase_22 AC 108 ms
98,404 KB
testcase_23 AC 150 ms
113,368 KB
testcase_24 AC 102 ms
100,716 KB
testcase_25 AC 140 ms
113,172 KB
testcase_26 AC 129 ms
111,612 KB
testcase_27 AC 146 ms
113,356 KB
testcase_28 AC 124 ms
108,572 KB
testcase_29 AC 137 ms
113,092 KB
testcase_30 AC 114 ms
104,956 KB
testcase_31 AC 139 ms
113,208 KB
testcase_32 AC 159 ms
112,716 KB
testcase_33 AC 141 ms
113,272 KB
testcase_34 AC 113 ms
101,532 KB
testcase_35 AC 142 ms
113,088 KB
testcase_36 AC 134 ms
112,572 KB
testcase_37 AC 146 ms
113,040 KB
testcase_38 AC 131 ms
112,416 KB
testcase_39 AC 140 ms
113,376 KB
testcase_40 AC 129 ms
111,204 KB
testcase_41 AC 140 ms
113,064 KB
testcase_42 AC 122 ms
107,896 KB
testcase_43 AC 138 ms
113,300 KB
testcase_44 AC 103 ms
97,628 KB
testcase_45 AC 140 ms
113,172 KB
testcase_46 AC 134 ms
112,144 KB
testcase_47 AC 140 ms
113,016 KB
testcase_48 AC 108 ms
100,472 KB
testcase_49 AC 136 ms
113,228 KB
testcase_50 AC 110 ms
100,228 KB
testcase_51 AC 141 ms
116,220 KB
testcase_52 AC 129 ms
111,412 KB
testcase_53 AC 142 ms
113,592 KB
testcase_54 AC 140 ms
113,536 KB
testcase_55 AC 143 ms
112,968 KB
testcase_56 AC 144 ms
113,192 KB
testcase_57 AC 102 ms
97,684 KB
testcase_58 AC 120 ms
104,496 KB
testcase_59 AC 116 ms
104,072 KB
testcase_60 AC 108 ms
98,116 KB
testcase_61 WA -
testcase_62 AC 134 ms
111,444 KB
testcase_63 AC 36 ms
53,204 KB
testcase_64 AC 36 ms
53,420 KB
testcase_65 AC 38 ms
52,500 KB
testcase_66 AC 36 ms
53,024 KB
testcase_67 AC 36 ms
53,028 KB
testcase_68 AC 36 ms
53,972 KB
testcase_69 AC 36 ms
52,460 KB
testcase_70 AC 35 ms
52,768 KB
testcase_71 AC 34 ms
54,044 KB
testcase_72 AC 38 ms
51,996 KB
testcase_73 AC 35 ms
53,140 KB
testcase_74 AC 34 ms
52,212 KB
testcase_75 AC 37 ms
53,448 KB
testcase_76 AC 34 ms
52,884 KB
testcase_77 AC 34 ms
53,404 KB
testcase_78 AC 34 ms
52,604 KB
testcase_79 AC 34 ms
52,696 KB
testcase_80 AC 35 ms
52,276 KB
testcase_81 AC 35 ms
53,112 KB
testcase_82 AC 38 ms
52,284 KB
testcase_83 AC 38 ms
52,788 KB
testcase_84 AC 39 ms
53,604 KB
testcase_85 AC 36 ms
53,160 KB
testcase_86 AC 34 ms
52,212 KB
testcase_87 AC 34 ms
52,556 KB
testcase_88 AC 38 ms
52,468 KB
testcase_89 AC 35 ms
53,584 KB
testcase_90 AC 35 ms
53,492 KB
testcase_91 AC 34 ms
52,920 KB
testcase_92 AC 36 ms
52,404 KB
testcase_93 AC 36 ms
52,552 KB
testcase_94 AC 36 ms
53,416 KB
testcase_95 AC 35 ms
53,992 KB
testcase_96 AC 34 ms
52,332 KB
testcase_97 AC 39 ms
52,940 KB
testcase_98 AC 35 ms
52,404 KB
testcase_99 AC 35 ms
53,224 KB
testcase_100 AC 35 ms
52,892 KB
testcase_101 AC 36 ms
52,644 KB
testcase_102 AC 36 ms
53,140 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
A = list(map(int, input().split()))

if n <= 100:
    for i in range(n):
        for j in range(i + 1, n):
            for p in range(1, n + 1):
                for q in range(p + 1, n + 1):
                    if (A[i] + p) ^ (A[j] + q) == (A[i] + q) ^ (A[j] + p):
                        P = [0] * n
                        Q = [0] * n
                        P[i] = p
                        P[j] = q
                        Q[i] = q
                        Q[j] = p
                        x = 1
                        for k in range(n):
                            if k == i or k == j:
                                continue
                            while x == p or x == q:
                                x += 1
                            P[k] = x
                            Q[k] = x
                            x += 1

                        print(*P)
                        print(*Q)
                        exit()
    print(-1)
else:
    ind = [-1] * 60
    for i, a in enumerate(A):
        c = 0
        while a:
            if a & 1:
                c += 1
            else:
                break
            a >>= 1
        if ind[c] == -1:
            ind[c] = i
        else:
            j = ind[c]
            P = [0] * n
            Q = [0] * n
            p = 2
            q = 3
            P[i] = p
            P[j] = q
            Q[i] = q
            Q[j] = p
            x = 1
            for k in range(n):
                if k == i or k == j:
                    continue
                while x == p or x == q:
                    x += 1
                P[k] = x
                Q[k] = x
                x += 1

            print(*P)
            print(*Q)
            exit()
0