結果
問題 | No.1989 Pairing Multiset |
ユーザー |
![]() |
提出日時 | 2022-06-24 22:59:51 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 61 ms / 2,000 ms |
コード長 | 695 bytes |
コンパイル時間 | 376 ms |
コンパイル使用メモリ | 82,560 KB |
実行使用メモリ | 57,728 KB |
最終ジャッジ日時 | 2024-11-08 18:43:57 |
合計ジャッジ時間 | 2,327 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 |
ソースコード
mod = 998244353def main():import sysfrom itertools import combinations_with_replacementinput = sys.stdin.readlinedef guchoku(N, M):res = 0for p in combinations_with_replacement(list(range(M+1)), 2 * N):p = list(p)#print(p)for i in range(N):res += p[i*2+1] - p[i*2]return resN, M = map(int, input().split())#print(guchoku(N, M))upper = Nlower = 1for i in range(2 * N + 1):upper = (upper * (M + 2 * N - i)) % modlower = (lower * (2 * N + 1 - i)) % modprint((upper * pow(lower, mod - 2, mod)) % mod)if __name__ == '__main__':main()