結果

問題 No.1809 Divide NCK
コンテスト
ユーザー ntuda
提出日時 2025-11-08 20:17:33
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 193 bytes
コンパイル時間 3,423 ms
コンパイル使用メモリ 82,148 KB
実行使用メモリ 53,876 KB
最終ジャッジ日時 2025-11-08 20:17:44
合計ジャッジ時間 4,231 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17 WA * 22
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

def calc(x):
    ret = 0
    now = M
    while now <= x:
        ret += x // now
        now *= M
    return ret

N,K,M = map(int,input().split())
ans = calc(N) - calc(N-K) - calc(K)
print(ans)
0