結果
問題 | No.1553 Lovely City |
ユーザー |
![]() |
提出日時 | 2021-06-18 22:00:32 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 375 bytes |
コンパイル時間 | 299 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 61,056 KB |
最終ジャッジ日時 | 2024-06-22 20:22:08 |
合計ジャッジ時間 | 8,178 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 2 |
other | WA * 26 |
ソースコード
P = 998244353N, M = map(int, input().split())ans = 0s = 0for i in range(1, M + 1):po = pow(i, N - 1, P)ans += i * (i + 1) // 2 % P * i % P * pos += M - i + 1s %= Pans -= s * (M - i + 1) % P * poif i < M:ans -= i * (i + 1) // 2 % P * (i + 1) % P * poans += s * (M - i + 0) % P * poans %= Pans *= Nans %= Pprint(ans)