結果
問題 | No.2225 Treasure Searching Rod (Easy) |
ユーザー | Hydru |
提出日時 | 2023-02-24 21:46:05 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 329 ms / 2,000 ms |
コード長 | 368 bytes |
コンパイル時間 | 162 ms |
コンパイル使用メモリ | 82,436 KB |
実行使用メモリ | 76,980 KB |
最終ジャッジ日時 | 2024-09-13 05:18:30 |
合計ジャッジ時間 | 4,966 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 23 |
ソースコード
mod=998244353 h,w,k=map(int,input().split()) D=dict() for _ in range(k): x,y,v=map(int,input().split()) D[(x-1,y-1)]=v ans=0 for i in range(h): for j in range(w): for x in range(h): for y in range(w): if x+y>=i+j and x-y>=i-j and (x,y) in D: ans+=D[(x,y)] ans%=mod print(ans)