結果
問題 | No.1809 Divide NCK |
ユーザー |
👑 ![]() |
提出日時 | 2022-01-14 21:40:16 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 410 bytes |
コンパイル時間 | 177 ms |
コンパイル使用メモリ | 82,128 KB |
実行使用メモリ | 59,740 KB |
最終ジャッジ日時 | 2024-11-20 08:45:58 |
合計ジャッジ時間 | 3,893 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 26 WA * 13 |
ソースコード
def cont(x,M):ret = 0div = Mwhile x >= div:ret += x // divdiv *= Mreturn retN,K,M = map(int,input().split())q = set()for i in range(2,10**6+1):if M % i == 0:q.add(i)while M % i == 0:M //= iif M != 1:q.add(i)ans = float("inf")for mod in q:ans = min( ans , cont(N,mod) - cont(K,mod) - cont(N-K,mod) )print (ans)