結果

問題 No.2719 Equal Inner Products in Permutation
ユーザー minimum
提出日時 2024-04-05 22:29:56
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 514 bytes
コンパイル時間 275 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 155,264 KB
最終ジャッジ日時 2024-10-01 02:41:42
合計ジャッジ時間 7,769 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 23 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
if N == 1:
    exit(print(-1))

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]
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
print(*ans)
0