結果

問題 No.83 最大マッチング
ユーザー 🍡yurahuna🍡yurahuna
提出日時 2015-12-20 12:50:15
言語 Python2
(2.7.18)
結果
AC  
実行時間 30 ms / 5,000 ms
コード長 310 bytes
コンパイル時間 112 ms
コンパイル使用メモリ 7,048 KB
実行使用メモリ 6,956 KB
最終ジャッジ日時 2023-10-17 14:12:44
合計ジャッジ時間 933 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
6,444 KB
testcase_01 AC 12 ms
6,444 KB
testcase_02 AC 11 ms
6,444 KB
testcase_03 AC 12 ms
6,444 KB
testcase_04 AC 11 ms
6,444 KB
testcase_05 AC 11 ms
6,444 KB
testcase_06 AC 10 ms
6,444 KB
testcase_07 AC 9 ms
6,444 KB
testcase_08 AC 10 ms
6,444 KB
testcase_09 AC 13 ms
6,500 KB
testcase_10 AC 24 ms
6,740 KB
testcase_11 AC 30 ms
6,956 KB
testcase_12 AC 30 ms
6,956 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#左から決めていく
#残り4本以上or2本→2本を「1」にする
#残り3本→「7」にする
#最後にひっくりかえす

N = input()
x = N
s = []

while x > 0:
    if x >= 4 or x == 2:
        x = x-2
        s += "1"
    elif x == 3:
        x = x-3
        s += "7"

print "".join(s)[::-1]
0