結果

問題 No.2732 Similar Permutations
ユーザー hiro1729hiro1729
提出日時 2024-04-09 17:20:48
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 684 bytes
コンパイル時間 828 ms
コンパイル使用メモリ 82,920 KB
実行使用メモリ 637,228 KB
最終ジャッジ日時 2024-04-09 17:23:27
合計ジャッジ時間 157,850 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
61,548 KB
testcase_01 AC 39 ms
54,044 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,292 KB
testcase_64 AC 41 ms
54,628 KB
testcase_65 AC 40 ms
55,180 KB
testcase_66 AC 41 ms
54,680 KB
testcase_67 AC 40 ms
54,380 KB
testcase_68 AC 40 ms
55,176 KB
testcase_69 AC 41 ms
54,500 KB
testcase_70 AC 40 ms
54,068 KB
testcase_71 AC 41 ms
55,176 KB
testcase_72 AC 41 ms
55,004 KB
testcase_73 AC 40 ms
54,524 KB
testcase_74 AC 41 ms
54,068 KB
testcase_75 AC 39 ms
54,320 KB
testcase_76 AC 40 ms
54,496 KB
testcase_77 AC 40 ms
55,860 KB
testcase_78 AC 40 ms
56,032 KB
testcase_79 AC 41 ms
54,216 KB
testcase_80 AC 41 ms
53,788 KB
testcase_81 AC 40 ms
54,536 KB
testcase_82 AC 42 ms
54,772 KB
testcase_83 AC 46 ms
62,572 KB
testcase_84 AC 45 ms
61,560 KB
testcase_85 AC 45 ms
61,728 KB
testcase_86 AC 46 ms
61,952 KB
testcase_87 AC 47 ms
63,312 KB
testcase_88 AC 45 ms
62,172 KB
testcase_89 AC 47 ms
62,620 KB
testcase_90 AC 47 ms
63,704 KB
testcase_91 AC 54 ms
69,796 KB
testcase_92 AC 54 ms
70,496 KB
testcase_93 AC 54 ms
70,184 KB
testcase_94 AC 54 ms
69,860 KB
testcase_95 AC 168 ms
108,164 KB
testcase_96 AC 179 ms
110,572 KB
testcase_97 AC 165 ms
108,640 KB
testcase_98 AC 170 ms
107,352 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