結果
| 問題 |
No.2130 分配方法の数え上げ mod 998244353
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-11-25 21:52:36 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 249 bytes |
| コンパイル時間 | 176 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 18,720 KB |
| 最終ジャッジ日時 | 2024-10-02 04:27:25 |
| 合計ジャッジ時間 | 5,569 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 11 WA * 8 TLE * 1 -- * 18 |
ソースコード
from functools import lru_cache
n = int(input())
m = int(input())
@lru_cache
def nPr(n,r):
npr=1
for i in range(n,n-r,-1):
npr*=i
return npr
sum = 0
if n-m >= 0:
for i in range(n-m+1):
sum += nPr(n,i)
print(sum % 998244353)