結果

問題 No.2719 Equal Inner Products in Permutation
ユーザー minimumminimum
提出日時 2024-04-05 22:29:56
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 514 bytes
コンパイル時間 161 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 154,808 KB
最終ジャッジ日時 2024-04-05 22:30:11
合計ジャッジ時間 8,353 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,460 KB
testcase_01 AC 39 ms
53,460 KB
testcase_02 AC 38 ms
53,460 KB
testcase_03 AC 37 ms
53,460 KB
testcase_04 WA -
testcase_05 AC 37 ms
53,460 KB
testcase_06 AC 36 ms
53,460 KB
testcase_07 WA -
testcase_08 AC 37 ms
53,460 KB
testcase_09 AC 36 ms
53,460 KB
testcase_10 AC 47 ms
62,044 KB
testcase_11 AC 47 ms
64,164 KB
testcase_12 AC 47 ms
62,044 KB
testcase_13 AC 50 ms
62,048 KB
testcase_14 WA -
testcase_15 AC 154 ms
141,148 KB
testcase_16 AC 165 ms
150,128 KB
testcase_17 AC 126 ms
119,156 KB
testcase_18 AC 164 ms
150,724 KB
testcase_19 WA -
testcase_20 AC 123 ms
115,652 KB
testcase_21 WA -
testcase_22 AC 141 ms
126,040 KB
testcase_23 AC 130 ms
122,524 KB
testcase_24 AC 118 ms
113,616 KB
testcase_25 WA -
testcase_26 AC 168 ms
152,164 KB
testcase_27 AC 167 ms
154,808 KB
testcase_28 WA -
testcase_29 AC 174 ms
152,164 KB
testcase_30 AC 171 ms
154,788 KB
権限があれば一括ダウンロードができます

ソースコード

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