結果

問題 No.2732 Similar Permutations
ユーザー hiro1729hiro1729
提出日時 2024-04-09 17:23:03
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 684 bytes
コンパイル時間 805 ms
コンパイル使用メモリ 82,428 KB
実行使用メモリ 636,988 KB
最終ジャッジ日時 2024-04-09 17:25:37
合計ジャッジ時間 148,243 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
61,512 KB
testcase_01 AC 42 ms
55,540 KB
testcase_02 TLE -
testcase_03 TLE -
testcase_04 TLE -
testcase_05 TLE -
testcase_06 TLE -
testcase_07 TLE -
testcase_08 TLE -
testcase_09 TLE -
testcase_10 TLE -
testcase_11 TLE -
testcase_12 TLE -
testcase_13 TLE -
testcase_14 TLE -
testcase_15 TLE -
testcase_16 TLE -
testcase_17 TLE -
testcase_18 TLE -
testcase_19 TLE -
testcase_20 TLE -
testcase_21 TLE -
testcase_22 TLE -
testcase_23 TLE -
testcase_24 TLE -
testcase_25 TLE -
testcase_26 TLE -
testcase_27 TLE -
testcase_28 TLE -
testcase_29 TLE -
testcase_30 TLE -
testcase_31 TLE -
testcase_32 TLE -
testcase_33 TLE -
testcase_34 TLE -
testcase_35 TLE -
testcase_36 TLE -
testcase_37 TLE -
testcase_38 TLE -
testcase_39 TLE -
testcase_40 TLE -
testcase_41 TLE -
testcase_42 TLE -
testcase_43 TLE -
testcase_44 TLE -
testcase_45 TLE -
testcase_46 TLE -
testcase_47 TLE -
testcase_48 TLE -
testcase_49 TLE -
testcase_50 TLE -
testcase_51 TLE -
testcase_52 TLE -
testcase_53 TLE -
testcase_54 TLE -
testcase_55 TLE -
testcase_56 TLE -
testcase_57 TLE -
testcase_58 TLE -
testcase_59 TLE -
testcase_60 TLE -
testcase_61 TLE -
testcase_62 TLE -
testcase_63 AC 42 ms
54,904 KB
testcase_64 AC 41 ms
55,176 KB
testcase_65 AC 41 ms
55,244 KB
testcase_66 AC 41 ms
54,804 KB
testcase_67 AC 41 ms
54,380 KB
testcase_68 AC 41 ms
54,684 KB
testcase_69 AC 42 ms
55,752 KB
testcase_70 AC 41 ms
54,432 KB
testcase_71 AC 43 ms
54,724 KB
testcase_72 AC 41 ms
54,368 KB
testcase_73 AC 42 ms
54,316 KB
testcase_74 AC 41 ms
54,584 KB
testcase_75 AC 41 ms
54,836 KB
testcase_76 AC 42 ms
55,448 KB
testcase_77 AC 41 ms
55,396 KB
testcase_78 AC 42 ms
55,312 KB
testcase_79 AC 42 ms
54,364 KB
testcase_80 AC 41 ms
53,788 KB
testcase_81 AC 41 ms
54,936 KB
testcase_82 AC 41 ms
55,400 KB
testcase_83 AC 46 ms
61,984 KB
testcase_84 AC 46 ms
62,084 KB
testcase_85 AC 47 ms
61,684 KB
testcase_86 AC 46 ms
62,612 KB
testcase_87 AC 47 ms
62,592 KB
testcase_88 AC 47 ms
62,072 KB
testcase_89 AC 47 ms
62,440 KB
testcase_90 AC 47 ms
62,188 KB
testcase_91 AC 55 ms
71,168 KB
testcase_92 AC 54 ms
70,140 KB
testcase_93 AC 55 ms
69,400 KB
testcase_94 AC 54 ms
70,012 KB
testcase_95 AC 169 ms
108,216 KB
testcase_96 AC 183 ms
110,820 KB
testcase_97 AC 164 ms
108,300 KB
testcase_98 AC 176 ms
107,052 KB
testcase_99 MLE -
testcase_100 MLE -
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 list(permutations(list(range(1, 11))))[1:]:
	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