結果
| 問題 |
No.2225 Treasure Searching Rod (Easy)
|
| コンテスト | |
| ユーザー |
lam6er
|
| 提出日時 | 2025-03-20 21:16:12 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 73 ms / 2,000 ms |
| コード長 | 366 bytes |
| コンパイル時間 | 622 ms |
| コンパイル使用メモリ | 82,192 KB |
| 実行使用メモリ | 71,744 KB |
| 最終ジャッジ日時 | 2025-03-20 21:17:02 |
| 合計ジャッジ時間 | 2,502 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 23 |
ソースコード
MOD = 998244353
H, W, K = map(int, input().split())
total = 0
for _ in range(K):
x, y, v = map(int, input().split())
s = x + y
t = x - y
cnt = 0
for i in range(1, H + 1):
lower = max(1, i - t)
upper = min(s - i, W)
if upper >= lower:
cnt += upper - lower + 1
total = (total + v * cnt) % MOD
print(total)
lam6er