結果
問題 | No.2732 Similar Permutations |
ユーザー | 👑 rin204 |
提出日時 | 2024-04-20 01:33:37 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 171 ms / 2,000 ms |
コード長 | 1,821 bytes |
コンパイル時間 | 689 ms |
コンパイル使用メモリ | 81,920 KB |
実行使用メモリ | 115,712 KB |
最終ジャッジ日時 | 2024-10-11 20:22:51 |
合計ジャッジ時間 | 22,601 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 37 ms
51,584 KB |
testcase_01 | AC | 37 ms
51,584 KB |
testcase_02 | AC | 84 ms
86,912 KB |
testcase_03 | AC | 109 ms
97,664 KB |
testcase_04 | AC | 77 ms
81,792 KB |
testcase_05 | AC | 69 ms
80,256 KB |
testcase_06 | AC | 63 ms
69,504 KB |
testcase_07 | AC | 99 ms
92,416 KB |
testcase_08 | AC | 72 ms
82,816 KB |
testcase_09 | AC | 58 ms
75,648 KB |
testcase_10 | AC | 157 ms
113,152 KB |
testcase_11 | AC | 54 ms
72,320 KB |
testcase_12 | AC | 153 ms
112,896 KB |
testcase_13 | AC | 145 ms
113,024 KB |
testcase_14 | AC | 146 ms
112,896 KB |
testcase_15 | AC | 149 ms
112,640 KB |
testcase_16 | AC | 121 ms
104,448 KB |
testcase_17 | AC | 122 ms
104,448 KB |
testcase_18 | AC | 150 ms
112,640 KB |
testcase_19 | AC | 150 ms
113,152 KB |
testcase_20 | AC | 147 ms
112,640 KB |
testcase_21 | AC | 152 ms
112,896 KB |
testcase_22 | AC | 118 ms
97,920 KB |
testcase_23 | AC | 143 ms
113,024 KB |
testcase_24 | AC | 106 ms
99,968 KB |
testcase_25 | AC | 171 ms
113,024 KB |
testcase_26 | AC | 132 ms
111,468 KB |
testcase_27 | AC | 147 ms
113,024 KB |
testcase_28 | AC | 125 ms
108,032 KB |
testcase_29 | AC | 151 ms
113,152 KB |
testcase_30 | AC | 124 ms
104,684 KB |
testcase_31 | AC | 158 ms
113,096 KB |
testcase_32 | AC | 153 ms
112,512 KB |
testcase_33 | AC | 158 ms
113,332 KB |
testcase_34 | AC | 111 ms
101,340 KB |
testcase_35 | AC | 161 ms
113,152 KB |
testcase_36 | AC | 151 ms
112,128 KB |
testcase_37 | AC | 158 ms
113,024 KB |
testcase_38 | AC | 147 ms
112,152 KB |
testcase_39 | AC | 153 ms
113,152 KB |
testcase_40 | AC | 139 ms
111,232 KB |
testcase_41 | AC | 146 ms
112,640 KB |
testcase_42 | AC | 124 ms
107,880 KB |
testcase_43 | AC | 145 ms
112,896 KB |
testcase_44 | AC | 103 ms
97,280 KB |
testcase_45 | AC | 145 ms
112,640 KB |
testcase_46 | AC | 152 ms
112,256 KB |
testcase_47 | AC | 160 ms
112,640 KB |
testcase_48 | AC | 109 ms
100,480 KB |
testcase_49 | AC | 160 ms
113,152 KB |
testcase_50 | AC | 107 ms
100,096 KB |
testcase_51 | AC | 157 ms
115,712 KB |
testcase_52 | AC | 129 ms
111,360 KB |
testcase_53 | AC | 155 ms
113,128 KB |
testcase_54 | AC | 159 ms
112,896 KB |
testcase_55 | AC | 142 ms
113,024 KB |
testcase_56 | AC | 144 ms
113,152 KB |
testcase_57 | AC | 99 ms
97,280 KB |
testcase_58 | AC | 116 ms
103,936 KB |
testcase_59 | AC | 112 ms
103,988 KB |
testcase_60 | AC | 106 ms
97,664 KB |
testcase_61 | AC | 95 ms
95,744 KB |
testcase_62 | AC | 138 ms
111,104 KB |
testcase_63 | AC | 43 ms
51,840 KB |
testcase_64 | AC | 41 ms
51,584 KB |
testcase_65 | AC | 41 ms
51,968 KB |
testcase_66 | AC | 41 ms
52,096 KB |
testcase_67 | AC | 37 ms
52,224 KB |
testcase_68 | AC | 38 ms
51,840 KB |
testcase_69 | AC | 37 ms
51,968 KB |
testcase_70 | AC | 37 ms
52,096 KB |
testcase_71 | AC | 37 ms
51,968 KB |
testcase_72 | AC | 38 ms
52,096 KB |
testcase_73 | AC | 36 ms
51,712 KB |
testcase_74 | AC | 37 ms
51,968 KB |
testcase_75 | AC | 36 ms
52,096 KB |
testcase_76 | AC | 36 ms
52,352 KB |
testcase_77 | AC | 37 ms
52,096 KB |
testcase_78 | AC | 41 ms
51,968 KB |
testcase_79 | AC | 37 ms
52,352 KB |
testcase_80 | AC | 37 ms
51,840 KB |
testcase_81 | AC | 38 ms
52,096 KB |
testcase_82 | AC | 38 ms
52,480 KB |
testcase_83 | AC | 37 ms
52,352 KB |
testcase_84 | AC | 39 ms
51,840 KB |
testcase_85 | AC | 41 ms
52,480 KB |
testcase_86 | AC | 36 ms
51,968 KB |
testcase_87 | AC | 37 ms
51,584 KB |
testcase_88 | AC | 37 ms
51,840 KB |
testcase_89 | AC | 38 ms
51,968 KB |
testcase_90 | AC | 38 ms
52,096 KB |
testcase_91 | AC | 37 ms
52,480 KB |
testcase_92 | AC | 37 ms
51,584 KB |
testcase_93 | AC | 38 ms
51,968 KB |
testcase_94 | AC | 41 ms
52,096 KB |
testcase_95 | AC | 37 ms
52,480 KB |
testcase_96 | AC | 37 ms
52,096 KB |
testcase_97 | AC | 39 ms
52,480 KB |
testcase_98 | AC | 37 ms
52,224 KB |
testcase_99 | AC | 37 ms
51,840 KB |
testcase_100 | AC | 37 ms
51,712 KB |
testcase_101 | AC | 38 ms
51,712 KB |
testcase_102 | AC | 37 ms
51,584 KB |
ソースコード
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 if c != 1: p = 2 q = 3 else: p = 4 q = 5 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()