結果
| 問題 |
No.2225 Treasure Searching Rod (Easy)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-02-24 22:05:26 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 167 ms / 2,000 ms |
| コード長 | 506 bytes |
| コンパイル時間 | 374 ms |
| コンパイル使用メモリ | 81,548 KB |
| 実行使用メモリ | 77,644 KB |
| 最終ジャッジ日時 | 2024-09-13 05:31:47 |
| 合計ジャッジ時間 | 3,203 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 23 |
ソースコード
import sys,random,bisect
from collections import deque,defaultdict
from heapq import heapify,heappop,heappush
from itertools import permutations
from math import gcd,log
input = lambda :sys.stdin.readline().rstrip()
mi = lambda :map(int,input().split())
li = lambda :list(mi())
H,W,K = mi()
tre = [tuple(mi()) for i in range(K)]
res = 0
for i in range(1,H+1):
for j in range(1,W+1):
for x,y,v in tre:
if x+y >= i+j and x-y >= i-j:
res += v
print(res % 998244353)