結果
| 問題 |
No.83 最大マッチング
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-11-18 12:36:28 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 678 bytes |
| コンパイル時間 | 413 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-11-25 11:29:52 |
| 合計ジャッジ時間 | 1,589 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | WA * 10 |
ソースコード
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()