結果

問題 No.3045 反復重み付き累積和
ユーザー lam6er
提出日時 2025-04-15 20:51:08
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 362 bytes
コンパイル時間 168 ms
コンパイル使用メモリ 82,728 KB
実行使用メモリ 54,104 KB
最終ジャッジ日時 2025-04-15 20:52:04
合計ジャッジ時間 2,703 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 41
権限があれば一括ダウンロードができます

ソースコード

diff #

def count_factors(k, p):
    res = 0
    while k > 0:
        k = k // p
        res += k
    return res

n, m = map(int, input().split())

count_2_n = count_factors(n, 2)
count_5_n = count_factors(n, 5)
count_2_m = count_factors(m, 2)
count_5_m = count_factors(m, 5)

total_2 = count_2_n + count_2_m
total_5 = count_5_n + count_5_m

print(min(total_2, total_5))
0