結果

問題 No.83 最大マッチング
コンテスト
ユーザー mokrai
提出日時 2017-11-18 12:36:28
言語 Python3
(3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
WA  
実行時間 -
コード長 678 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 56 ms
コンパイル使用メモリ 15,232 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2026-09-29 20:53:36
合計ジャッジ時間 1,813 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

def main():
    N = int(input())
    num_dic = {2:0, 3:0, 5:0, 7:0}

    while N % 2 == 0:
        N = N / 2
        num_dic[2] += 1

    while N % 3 == 0:
        N = N / 3
        num_dic[3] += 1

    while N % 5 == 0:
        N = N / 5
        num_dic[5] += 1

    while N % 7 == 0:
        N = N / 7
        num_dic[7] += 1

    #print(num_dic)

    ans = ""
    if num_dic[7] != 0:
        ans = ans + str(8) * num_dic[7] 
    if num_dic[3] != 0:
        ans = ans + str(7) * num_dic[3] 
    if num_dic[5] != 0:
        ans = ans + str(5) * num_dic[5] 
    if num_dic[2] != 0:
        ans = ans + str(1) * num_dic[2] 

    print(ans)

if __name__ == '__main__':
    main()
0