結果
| 問題 | No.2229 Treasure Searching Rod (Hard) |
| コンテスト | |
| ユーザー |
Kude
|
| 提出日時 | 2023-02-24 21:46:45 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 136 ms / 2,000 ms |
| + 207µs | |
| コード長 | 351 bytes |
| 記録 | |
| コンパイル時間 | 79 ms |
| コンパイル使用メモリ | 64,676 KB |
| 実行使用メモリ | 60,408 KB |
| 最終ジャッジ日時 | 2026-10-17 01:54:17 |
| 合計ジャッジ時間 | 7,604 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 29 |
ソースコード
h, w, k = map(int, input().split())
ans = 0
for _ in range(k):
x, y, v = map(int, input().split())
x -= 1
y -= 1
s = 0
s += (x + 1) ** 2
x1 = x - y - 1
if x1 >= 0:
s -= (x1 + 1) * (x1 + 2) // 2
x2 = x - (w - y)
if x2 >= 0:
s -= (x2 + 1) * (x2 + 2) // 2
ans = (ans + s * v) % 998244353
print(ans)
Kude