結果
問題 |
No.2719 Equal Inner Products in Permutation
|
ユーザー |
|
提出日時 | 2024-04-05 22:35:12 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 670 bytes |
コンパイル時間 | 209 ms |
コンパイル使用メモリ | 82,536 KB |
実行使用メモリ | 154,880 KB |
最終ジャッジ日時 | 2024-10-01 02:45:08 |
合計ジャッジ時間 | 7,272 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 29 RE * 1 |
ソースコード
def solve(N): if N == 1: ans = [-1] return a, b, c = [], [], [] s = 0 if N % 3 == 1: a, b, c = [1, 2, 4, 11], [7, 9, 10, 12], [8, 5, 6, 3] s = 12 elif N % 3 == 2: a, b, c = [1, 4], [3, 6], [5, 2] s = 6 else: a, b, c = [1, 2, 9], [6, 8, 7], [3, 4, 5] s = 9 while len(a) < N: a.append(s + 1) a.append(s + 2) a.append(s + 9) b.append(s + 6) b.append(s + 8) b.append(s + 7) c.append(s + 3) c.append(s + 4) c.append(s + 5) s += 9 ans = a + b + c return ans N = int(input()) print(*solve(N))