結果
| 問題 |
No.2058 Binary String
|
| コンテスト | |
| ユーザー |
dachengz
|
| 提出日時 | 2022-11-16 08:50:21 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 272 bytes |
| コンパイル時間 | 148 ms |
| コンパイル使用メモリ | 82,292 KB |
| 実行使用メモリ | 67,160 KB |
| 最終ジャッジ日時 | 2024-09-17 06:37:04 |
| 合計ジャッジ時間 | 2,424 ms |
|
ジャッジサーバーID (参考情報) |
judge6 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 3 |
| other | RE * 23 |
ソースコード
N, K = map(int, input.split())
mod = 998244353
inv = [1] * (N + 1)
for i in range(2, N + 1):
inv[i] = mod - mod // i * inv[mod % i] % mod
ans = 0
c = 1
for i in range(N):
ans += c * pow(i, K, mod)
c = c * (N - i - 1) * inv[i + 1] % mod
ans %= mod
print(ans)
dachengz