結果
問題 | No.2732 Similar Permutations |
ユーザー | hiro1729 |
提出日時 | 2024-04-09 07:18:42 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 676 bytes |
コンパイル時間 | 2,816 ms |
コンパイル使用メモリ | 81,664 KB |
実行使用メモリ | 510,712 KB |
最終ジャッジ日時 | 2024-10-01 17:09:18 |
合計ジャッジ時間 | 42,738 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 42 ms
58,624 KB |
testcase_01 | AC | 43 ms
53,376 KB |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | WA | - |
testcase_29 | WA | - |
testcase_30 | WA | - |
testcase_31 | WA | - |
testcase_32 | WA | - |
testcase_33 | WA | - |
testcase_34 | WA | - |
testcase_35 | WA | - |
testcase_36 | WA | - |
testcase_37 | WA | - |
testcase_38 | WA | - |
testcase_39 | WA | - |
testcase_40 | WA | - |
testcase_41 | WA | - |
testcase_42 | WA | - |
testcase_43 | WA | - |
testcase_44 | WA | - |
testcase_45 | WA | - |
testcase_46 | WA | - |
testcase_47 | WA | - |
testcase_48 | WA | - |
testcase_49 | WA | - |
testcase_50 | WA | - |
testcase_51 | WA | - |
testcase_52 | WA | - |
testcase_53 | WA | - |
testcase_54 | WA | - |
testcase_55 | WA | - |
testcase_56 | WA | - |
testcase_57 | WA | - |
testcase_58 | WA | - |
testcase_59 | WA | - |
testcase_60 | WA | - |
testcase_61 | WA | - |
testcase_62 | WA | - |
testcase_63 | AC | 47 ms
53,376 KB |
testcase_64 | AC | 47 ms
53,376 KB |
testcase_65 | AC | 45 ms
53,504 KB |
testcase_66 | AC | 46 ms
53,632 KB |
testcase_67 | AC | 46 ms
53,504 KB |
testcase_68 | AC | 46 ms
53,632 KB |
testcase_69 | AC | 44 ms
53,632 KB |
testcase_70 | AC | 44 ms
53,376 KB |
testcase_71 | AC | 44 ms
53,248 KB |
testcase_72 | AC | 48 ms
53,120 KB |
testcase_73 | AC | 47 ms
53,632 KB |
testcase_74 | AC | 47 ms
53,120 KB |
testcase_75 | AC | 48 ms
53,120 KB |
testcase_76 | AC | 47 ms
53,376 KB |
testcase_77 | AC | 46 ms
53,120 KB |
testcase_78 | AC | 44 ms
53,504 KB |
testcase_79 | AC | 46 ms
53,760 KB |
testcase_80 | AC | 45 ms
53,504 KB |
testcase_81 | AC | 48 ms
53,376 KB |
testcase_82 | AC | 45 ms
53,760 KB |
testcase_83 | AC | 52 ms
60,800 KB |
testcase_84 | AC | 53 ms
61,056 KB |
testcase_85 | AC | 53 ms
60,800 KB |
testcase_86 | AC | 53 ms
60,800 KB |
testcase_87 | AC | 54 ms
61,568 KB |
testcase_88 | AC | 55 ms
61,952 KB |
testcase_89 | AC | 54 ms
61,824 KB |
testcase_90 | AC | 54 ms
61,952 KB |
testcase_91 | AC | 65 ms
69,632 KB |
testcase_92 | AC | 66 ms
68,864 KB |
testcase_93 | AC | 64 ms
69,120 KB |
testcase_94 | AC | 65 ms
68,864 KB |
testcase_95 | AC | 189 ms
107,776 KB |
testcase_96 | AC | 197 ms
110,464 KB |
testcase_97 | AC | 179 ms
108,160 KB |
testcase_98 | AC | 189 ms
107,008 KB |
testcase_99 | TLE | - |
testcase_100 | -- | - |
testcase_101 | -- | - |
testcase_102 | -- | - |
ソースコード
from itertools import permutations from collections import defaultdict N = int(input()) A = list(map(int, input().split())) if N <= 10: d = defaultdict(list) for p in permutations(list(range(1, N + 1))): x = 0 for i in range(N): x ^= A[i] + p[i] d[x].append(p) for c, ps in d.items(): if len(ps) >= 2: print(*ps[0]) print(*ps[1]) exit() exit(print(-1)) P = list(range(1, N + 1)) x = 0 for i in range(N): x ^= A[i] + i + 1 ax = 0 for i in range(10, N): ax ^= A[i] + (i + 1) for p in permutations(list(range(1, 11))): nx = 0 for i in range(10): nx ^= A[i] + p[i] if x == ax ^ nx: print(*P) print(*(list(p) + list(range(11, N + 1)))) exit()