結果
問題 |
No.2719 Equal Inner Products in Permutation
|
ユーザー |
![]() |
提出日時 | 2024-04-05 22:25:20 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,068 bytes |
コンパイル時間 | 347 ms |
コンパイル使用メモリ | 82,048 KB |
実行使用メモリ | 154,624 KB |
最終ジャッジ日時 | 2024-10-01 02:37:45 |
合計ジャッジ時間 | 7,321 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 29 WA * 1 |
ソースコード
N = int(input()) if N == 1: print(-1) if N % 4 == 0: P = [] Q = [] R = [] for i in range(N): if i % 4 == 0 or i % 4 == 3: P.append(3*i + 1) R.append(3*i + 2) else: P.append(3*i + 2) R.append(3*i + 1) Q.append(3*i + 3) elif N % 4 == 1: P = [1,4,7,8,14] Q = [3,6,12,13,15] R = [5,2,10,11,9] for i in range(5,N): j = i - 5 if j % 4 == 0 or j % 4 == 3: P.append(3*i + 1) R.append(3*i + 2) else: P.append(3*i + 2) R.append(3*i + 1) Q.append(3*i + 3) elif N % 4 == 2: P = [1,4] Q = [3,6] R = [5,2] for i in range(2,N): j = i - 2 if j % 4 == 0 or j % 4 == 3: P.append(3*i + 1) R.append(3*i + 2) else: P.append(3*i + 2) R.append(3*i + 1) Q.append(3*i + 3) else: P = [1,2,8] Q = [3,6,9] R = [7,5,4] for i in range(3,N): j = i - 3 if j % 4 == 0 or j % 4 == 3: P.append(3*i + 1) R.append(3*i + 2) else: P.append(3*i + 2) R.append(3*i + 1) Q.append(3*i + 3) ans = P + Q + R print(*ans)