結果
問題 |
No.2225 Treasure Searching Rod (Easy)
|
ユーザー |
👑 ![]() |
提出日時 | 2023-02-24 21:26:22 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 148 ms / 2,000 ms |
コード長 | 366 bytes |
コンパイル時間 | 189 ms |
コンパイル使用メモリ | 82,360 KB |
実行使用メモリ | 68,784 KB |
最終ジャッジ日時 | 2024-09-13 05:02:20 |
合計ジャッジ時間 | 2,842 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 23 |
ソースコード
import sys from sys import stdin H,W,K = map(int,stdin.readline().split()) xyv = [] for i in range(K): x,y,v = map(int,stdin.readline().split()) xyv.append( (x,y,v) ) ans = 0 for i in range(1,H+1): for j in range(1,W+1): for x,y,v in xyv: if x+y >= i+j and x-y >= i-j: ans += v print (ans % 998244353)