結果

問題 No.2732 Similar Permutations
コンテスト
ユーザー rlangevin
提出日時 2024-04-24 01:04:35
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 144 ms / 2,000 ms
コード長 370 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 219 ms
コンパイル使用メモリ 85,736 KB
実行使用メモリ 121,332 KB
最終ジャッジ日時 2026-05-06 09:59:31
合計ジャッジ時間 22,791 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 101
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

from itertools import *

N = int(input())
A = list(map(int, input().split()))
M = min(N, 10)
D = dict()
for t in permutations(range(1, M + 1)):
    v = 0
    for i in range(M):
        v ^= t[i] + A[i]
    if v in D:
        print(*(list(t) + list(range(M + 1, N + 1))))
        print(*(list(D[v]) + list(range(M + 1, N + 1))))
        exit()
    D[v] = t
    
print(-1)
0