結果

問題 No.796 well known
ユーザー _KingdomOfMoray_KingdomOfMoray
提出日時 2019-12-25 17:33:37
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 127 ms / 2,000 ms
コード長 519 bytes
コンパイル時間 521 ms
コンパイル使用メモリ 11,736 KB
実行使用メモリ 11,144 KB
最終ジャッジ日時 2023-10-25 21:47:01
合計ジャッジ時間 3,555 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,016 KB
testcase_01 AC 29 ms
10,016 KB
testcase_02 AC 30 ms
10,016 KB
testcase_03 AC 30 ms
10,016 KB
testcase_04 AC 103 ms
10,948 KB
testcase_05 AC 112 ms
11,012 KB
testcase_06 AC 127 ms
11,144 KB
testcase_07 AC 50 ms
10,496 KB
testcase_08 AC 113 ms
11,012 KB
testcase_09 AC 82 ms
10,792 KB
testcase_10 AC 123 ms
11,132 KB
testcase_11 AC 43 ms
10,368 KB
testcase_12 AC 71 ms
10,700 KB
testcase_13 AC 102 ms
10,940 KB
testcase_14 AC 63 ms
10,616 KB
testcase_15 AC 77 ms
10,732 KB
testcase_16 AC 126 ms
11,144 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())

candidate_list = []
candidate_list.append(3)

r = 2 * (n-1) % 3

if r == 0:
    candidate_list.append(3)
    for i in range(n-2):
        candidate_list.append(2)
elif r == 1:
    for i in range(n-1):
        candidate_list.append(2)
elif r == 2:
    candidate_list.append(1)
    for i in range(n-2):
        candidate_list.append(2)
        
for i in range(len(candidate_list)):
    if i == len(candidate_list) - 1:
        print(candidate_list[i])
    else:
        print(candidate_list[i], end=' ')
0