結果

問題 No.2719 Equal Inner Products in Permutation
ユーザー ecotteaecottea
提出日時 2024-02-03 19:24:21
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 563 bytes
コンパイル時間 173 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 847,956 KB
最終ジャッジ日時 2024-02-08 17:19:16
合計ジャッジ時間 3,792 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
55,596 KB
testcase_01 AC 40 ms
55,596 KB
testcase_02 AC 41 ms
55,596 KB
testcase_03 AC 40 ms
55,596 KB
testcase_04 RE -
testcase_05 MLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict

n = int(input())

if n == 1:
    print(-1)
    exit(0)

a2 = [1, 4]
b2 = [3, 6]
c2 = [5, 2]
a3 = [1, 2, 9]
b3 = [6, 8, 7]
c3 = [3, 4, 5]
a4 = [1, 2, 4, 11]
b4 = [7, 9, 10, 12]
c4 = [8, 5, 6, 3]

if n % 3 == 2:
    a = a2
    b = b2
    c = c2
elif n % 3 == 0:
    a = a3
    b = b3
    c = c3
else:
    a = a4
    b = b4
    c = c4

l = len(a)
while l < n:
    for x in a3:
        a.append(x + 3 * l)
    for x in b3:
        b.append(x + 3 * l)
    for x in c3:
        c.append(x + 3 * l)
    len += 3

print(*(a + b + c))
0