結果
問題 | No.2732 Similar Permutations |
ユーザー | 👑 rin204 |
提出日時 | 2024-04-20 01:31:10 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,728 bytes |
コンパイル時間 | 522 ms |
コンパイル使用メモリ | 82,048 KB |
実行使用メモリ | 115,328 KB |
最終ジャッジ日時 | 2024-10-11 20:20:24 |
合計ジャッジ時間 | 24,140 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 41 ms
51,584 KB |
testcase_01 | AC | 40 ms
51,456 KB |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | AC | 85 ms
81,792 KB |
testcase_05 | AC | 75 ms
80,000 KB |
testcase_06 | AC | 61 ms
69,248 KB |
testcase_07 | AC | 101 ms
92,160 KB |
testcase_08 | AC | 83 ms
82,944 KB |
testcase_09 | AC | 69 ms
75,392 KB |
testcase_10 | AC | 156 ms
113,024 KB |
testcase_11 | AC | 64 ms
71,808 KB |
testcase_12 | AC | 155 ms
112,640 KB |
testcase_13 | AC | 156 ms
112,640 KB |
testcase_14 | AC | 156 ms
112,896 KB |
testcase_15 | WA | - |
testcase_16 | AC | 129 ms
104,320 KB |
testcase_17 | AC | 131 ms
104,448 KB |
testcase_18 | WA | - |
testcase_19 | AC | 169 ms
112,640 KB |
testcase_20 | AC | 154 ms
113,152 KB |
testcase_21 | AC | 155 ms
113,152 KB |
testcase_22 | AC | 116 ms
97,920 KB |
testcase_23 | AC | 155 ms
112,896 KB |
testcase_24 | AC | 120 ms
100,352 KB |
testcase_25 | AC | 156 ms
112,768 KB |
testcase_26 | AC | 140 ms
110,848 KB |
testcase_27 | AC | 153 ms
113,152 KB |
testcase_28 | AC | 135 ms
108,160 KB |
testcase_29 | AC | 179 ms
112,896 KB |
testcase_30 | AC | 132 ms
104,192 KB |
testcase_31 | AC | 159 ms
112,640 KB |
testcase_32 | AC | 151 ms
112,384 KB |
testcase_33 | AC | 156 ms
113,408 KB |
testcase_34 | AC | 120 ms
101,376 KB |
testcase_35 | AC | 155 ms
112,896 KB |
testcase_36 | AC | 150 ms
112,512 KB |
testcase_37 | AC | 156 ms
113,152 KB |
testcase_38 | AC | 141 ms
111,488 KB |
testcase_39 | AC | 151 ms
112,896 KB |
testcase_40 | AC | 135 ms
111,232 KB |
testcase_41 | AC | 153 ms
113,152 KB |
testcase_42 | AC | 132 ms
107,776 KB |
testcase_43 | AC | 148 ms
113,024 KB |
testcase_44 | AC | 111 ms
97,024 KB |
testcase_45 | AC | 157 ms
112,640 KB |
testcase_46 | AC | 148 ms
112,000 KB |
testcase_47 | AC | 156 ms
113,152 KB |
testcase_48 | AC | 119 ms
100,352 KB |
testcase_49 | AC | 151 ms
113,152 KB |
testcase_50 | AC | 117 ms
100,352 KB |
testcase_51 | AC | 151 ms
115,328 KB |
testcase_52 | AC | 139 ms
110,848 KB |
testcase_53 | AC | 156 ms
112,896 KB |
testcase_54 | AC | 153 ms
113,152 KB |
testcase_55 | AC | 157 ms
112,896 KB |
testcase_56 | AC | 157 ms
112,640 KB |
testcase_57 | AC | 112 ms
97,024 KB |
testcase_58 | AC | 128 ms
104,576 KB |
testcase_59 | AC | 124 ms
103,552 KB |
testcase_60 | AC | 115 ms
97,664 KB |
testcase_61 | WA | - |
testcase_62 | AC | 146 ms
111,104 KB |
testcase_63 | AC | 40 ms
51,712 KB |
testcase_64 | AC | 40 ms
51,712 KB |
testcase_65 | AC | 40 ms
51,584 KB |
testcase_66 | AC | 40 ms
51,968 KB |
testcase_67 | AC | 40 ms
52,096 KB |
testcase_68 | AC | 40 ms
51,840 KB |
testcase_69 | AC | 40 ms
51,712 KB |
testcase_70 | AC | 41 ms
51,456 KB |
testcase_71 | AC | 41 ms
51,584 KB |
testcase_72 | AC | 40 ms
52,096 KB |
testcase_73 | AC | 40 ms
52,096 KB |
testcase_74 | AC | 40 ms
51,712 KB |
testcase_75 | AC | 41 ms
51,712 KB |
testcase_76 | AC | 41 ms
51,968 KB |
testcase_77 | AC | 41 ms
51,968 KB |
testcase_78 | AC | 42 ms
52,096 KB |
testcase_79 | AC | 42 ms
51,584 KB |
testcase_80 | AC | 41 ms
51,968 KB |
testcase_81 | AC | 41 ms
51,456 KB |
testcase_82 | AC | 41 ms
51,968 KB |
testcase_83 | AC | 40 ms
52,224 KB |
testcase_84 | AC | 40 ms
51,584 KB |
testcase_85 | AC | 40 ms
52,096 KB |
testcase_86 | AC | 40 ms
51,712 KB |
testcase_87 | AC | 40 ms
51,840 KB |
testcase_88 | AC | 42 ms
52,224 KB |
testcase_89 | AC | 40 ms
51,712 KB |
testcase_90 | AC | 41 ms
51,840 KB |
testcase_91 | AC | 41 ms
51,968 KB |
testcase_92 | AC | 41 ms
51,584 KB |
testcase_93 | AC | 40 ms
51,968 KB |
testcase_94 | AC | 41 ms
51,584 KB |
testcase_95 | AC | 41 ms
51,968 KB |
testcase_96 | AC | 41 ms
51,712 KB |
testcase_97 | AC | 40 ms
51,968 KB |
testcase_98 | AC | 41 ms
51,584 KB |
testcase_99 | AC | 41 ms
51,456 KB |
testcase_100 | AC | 40 ms
51,712 KB |
testcase_101 | AC | 40 ms
51,584 KB |
testcase_102 | AC | 40 ms
51,968 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 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()