結果
| 問題 | No.2732 Similar Permutations |
| コンテスト | |
| ユーザー |
detteiuu
|
| 提出日時 | 2026-07-19 15:57:45 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 197 ms / 2,000 ms |
| + 610µs | |
| コード長 | 539 bytes |
| 記録 | |
| コンパイル時間 | 224 ms |
| コンパイル使用メモリ | 95,944 KB |
| 実行使用メモリ | 166,624 KB |
| 最終ジャッジ日時 | 2026-07-19 15:58:15 |
| 合計ジャッジ時間 | 23,492 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 101 |
ソースコード
from itertools import permutations
N = int(input())
A = list(map(int, input().split()))
B = list(range(1, min(N, 10)+1))
C = [None for _ in range(10**6*5)]
for perm in permutations(B):
SUM = 0
for i, p in enumerate(perm):
SUM ^= A[i]+p
if C[SUM] is None:
C[SUM] = perm
else:
ans1 = list(C[SUM])
ans2 = list(perm)
if 10 < N:
ans1 += list(range(11, N+1))
ans2 += list(range(11, N+1))
print(*ans1)
print(*ans2)
break
else:
print(-1)
detteiuu