結果

問題 No.2732 Similar Permutations
ユーザー Yukino DX.Yukino DX.
提出日時 2024-04-20 10:59:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 161 ms / 2,000 ms
コード長 727 bytes
コンパイル時間 305 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 116,972 KB
最終ジャッジ日時 2024-04-20 10:59:38
合計ジャッジ時間 21,689 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
51,968 KB
testcase_01 AC 36 ms
51,840 KB
testcase_02 AC 77 ms
87,296 KB
testcase_03 AC 104 ms
97,920 KB
testcase_04 AC 68 ms
82,944 KB
testcase_05 AC 63 ms
80,476 KB
testcase_06 AC 52 ms
69,120 KB
testcase_07 AC 90 ms
92,552 KB
testcase_08 AC 75 ms
83,168 KB
testcase_09 AC 56 ms
75,520 KB
testcase_10 AC 161 ms
116,512 KB
testcase_11 AC 54 ms
71,900 KB
testcase_12 AC 146 ms
110,364 KB
testcase_13 AC 144 ms
110,464 KB
testcase_14 AC 144 ms
110,336 KB
testcase_15 AC 146 ms
110,468 KB
testcase_16 AC 121 ms
104,704 KB
testcase_17 AC 122 ms
104,704 KB
testcase_18 AC 140 ms
112,944 KB
testcase_19 AC 145 ms
110,668 KB
testcase_20 AC 145 ms
116,736 KB
testcase_21 AC 144 ms
110,336 KB
testcase_22 AC 106 ms
98,128 KB
testcase_23 AC 148 ms
110,720 KB
testcase_24 AC 111 ms
100,328 KB
testcase_25 AC 151 ms
110,768 KB
testcase_26 AC 138 ms
111,888 KB
testcase_27 AC 146 ms
110,336 KB
testcase_28 AC 125 ms
108,160 KB
testcase_29 AC 143 ms
110,592 KB
testcase_30 AC 123 ms
104,832 KB
testcase_31 AC 145 ms
110,336 KB
testcase_32 AC 140 ms
112,448 KB
testcase_33 AC 145 ms
110,592 KB
testcase_34 AC 112 ms
101,632 KB
testcase_35 AC 144 ms
110,456 KB
testcase_36 AC 133 ms
113,036 KB
testcase_37 AC 140 ms
110,504 KB
testcase_38 AC 135 ms
112,400 KB
testcase_39 AC 138 ms
110,556 KB
testcase_40 AC 133 ms
112,004 KB
testcase_41 AC 145 ms
110,504 KB
testcase_42 AC 143 ms
107,968 KB
testcase_43 AC 154 ms
116,972 KB
testcase_44 AC 101 ms
97,592 KB
testcase_45 AC 146 ms
116,792 KB
testcase_46 AC 137 ms
112,516 KB
testcase_47 AC 146 ms
116,532 KB
testcase_48 AC 110 ms
100,960 KB
testcase_49 AC 146 ms
116,288 KB
testcase_50 AC 107 ms
100,252 KB
testcase_51 AC 150 ms
116,056 KB
testcase_52 AC 135 ms
110,932 KB
testcase_53 AC 144 ms
110,480 KB
testcase_54 AC 143 ms
110,644 KB
testcase_55 AC 147 ms
110,344 KB
testcase_56 AC 137 ms
110,440 KB
testcase_57 AC 96 ms
97,936 KB
testcase_58 AC 118 ms
104,520 KB
testcase_59 AC 113 ms
104,040 KB
testcase_60 AC 98 ms
97,920 KB
testcase_61 AC 99 ms
95,600 KB
testcase_62 AC 134 ms
111,664 KB
testcase_63 AC 35 ms
52,684 KB
testcase_64 AC 33 ms
52,460 KB
testcase_65 AC 34 ms
52,268 KB
testcase_66 AC 34 ms
53,132 KB
testcase_67 AC 35 ms
53,528 KB
testcase_68 AC 34 ms
52,532 KB
testcase_69 AC 34 ms
52,884 KB
testcase_70 AC 38 ms
53,820 KB
testcase_71 AC 37 ms
52,124 KB
testcase_72 AC 36 ms
53,688 KB
testcase_73 AC 36 ms
53,476 KB
testcase_74 AC 35 ms
52,984 KB
testcase_75 AC 35 ms
52,744 KB
testcase_76 AC 35 ms
52,820 KB
testcase_77 AC 35 ms
52,712 KB
testcase_78 AC 34 ms
52,732 KB
testcase_79 AC 35 ms
53,088 KB
testcase_80 AC 35 ms
54,084 KB
testcase_81 AC 35 ms
53,508 KB
testcase_82 AC 34 ms
53,212 KB
testcase_83 AC 35 ms
52,340 KB
testcase_84 AC 35 ms
53,412 KB
testcase_85 AC 35 ms
52,660 KB
testcase_86 AC 34 ms
53,140 KB
testcase_87 AC 35 ms
52,464 KB
testcase_88 AC 34 ms
53,096 KB
testcase_89 AC 36 ms
52,072 KB
testcase_90 AC 35 ms
52,348 KB
testcase_91 AC 37 ms
52,536 KB
testcase_92 AC 35 ms
53,700 KB
testcase_93 AC 35 ms
52,820 KB
testcase_94 AC 35 ms
53,204 KB
testcase_95 AC 35 ms
52,876 KB
testcase_96 AC 37 ms
52,632 KB
testcase_97 AC 36 ms
52,312 KB
testcase_98 AC 36 ms
53,356 KB
testcase_99 AC 34 ms
52,864 KB
testcase_100 AC 35 ms
53,412 KB
testcase_101 AC 35 ms
53,008 KB
testcase_102 AC 37 ms
53,276 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import permutations

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

memo = dict()
if n < 10:
    for per in permutations(range(1, n + 1)):
        xor = 0
        for i in range(n):
            xor ^= a[i] + per[i]

        if xor in memo:
            print(*memo[xor])
            print(*per)
            exit()

        memo[xor] = tuple(per)

else:
    for per in permutations(range(n - 10 + 1, n + 1)):
        xor = 0
        for i in range(10):
            xor ^= a[n - 10 + i] + per[i]

        if xor in memo:
            print(*(tuple(range(1, n - 10 + 1)) + memo[xor]))
            print(*(tuple(range(1, n - 10 + 1)) + tuple(per)))
            exit()

        memo[xor] = tuple(per)

print(-1)
0