結果

問題 No.2732 Similar Permutations
ユーザー hiro1729hiro1729
提出日時 2024-04-09 07:18:42
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 676 bytes
コンパイル時間 436 ms
コンパイル使用メモリ 82,376 KB
実行使用メモリ 512,484 KB
最終ジャッジ日時 2024-04-09 07:19:18
合計ジャッジ時間 35,034 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
62,096 KB
testcase_01 AC 38 ms
55,456 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 42 ms
55,108 KB
testcase_64 AC 41 ms
53,852 KB
testcase_65 AC 39 ms
55,080 KB
testcase_66 AC 40 ms
55,416 KB
testcase_67 AC 39 ms
54,116 KB
testcase_68 AC 39 ms
53,936 KB
testcase_69 AC 39 ms
54,960 KB
testcase_70 AC 40 ms
53,800 KB
testcase_71 AC 41 ms
54,528 KB
testcase_72 AC 39 ms
55,784 KB
testcase_73 AC 40 ms
54,252 KB
testcase_74 AC 40 ms
54,632 KB
testcase_75 AC 40 ms
54,432 KB
testcase_76 AC 40 ms
53,840 KB
testcase_77 AC 40 ms
55,448 KB
testcase_78 AC 41 ms
54,724 KB
testcase_79 AC 41 ms
54,400 KB
testcase_80 AC 41 ms
55,044 KB
testcase_81 AC 41 ms
55,192 KB
testcase_82 AC 41 ms
54,736 KB
testcase_83 AC 48 ms
62,272 KB
testcase_84 AC 48 ms
62,724 KB
testcase_85 AC 72 ms
61,612 KB
testcase_86 AC 46 ms
61,608 KB
testcase_87 AC 46 ms
62,500 KB
testcase_88 AC 48 ms
62,900 KB
testcase_89 AC 47 ms
62,068 KB
testcase_90 AC 46 ms
62,168 KB
testcase_91 AC 55 ms
71,028 KB
testcase_92 AC 55 ms
69,952 KB
testcase_93 AC 55 ms
70,576 KB
testcase_94 AC 54 ms
69,972 KB
testcase_95 AC 168 ms
108,280 KB
testcase_96 AC 183 ms
110,948 KB
testcase_97 AC 217 ms
108,492 KB
testcase_98 AC 172 ms
107,200 KB
testcase_99 MLE -
testcase_100 -- -
testcase_101 -- -
testcase_102 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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()
0