結果
| 問題 | No.129 お年玉(2) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-08-27 00:43:26 |
| 言語 | PyPy2 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 341 bytes |
| 記録 | |
| コンパイル時間 | 136 ms |
| コンパイル使用メモリ | 77,508 KB |
| 最終ジャッジ日時 | 2025-12-04 01:21:09 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 5 WA * 41 |
ソースコード
import math mod = 10**9+7 def inv(x): return pow(x,mod-2,mod) def factorial(x): retval = 1 for i in range(2,x+1): retval = (retval * i)% mod return retval def nCr(n,r): return factorial(n) * inv(factorial(n-r)) * inv(factorial(r)) % mod n = int(input()) m = int(input()) rest = (n%(1000*m)) print nCr(m,(rest - (rest%1000))/1000)