結果

問題 No.2225 Treasure Searching Rod (Easy)
ユーザー chineristACchineristAC
提出日時 2023-02-24 22:05:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 230 ms / 2,000 ms
コード長 506 bytes
コンパイル時間 294 ms
コンパイル使用メモリ 87,116 KB
実行使用メモリ 81,804 KB
最終ジャッジ日時 2023-10-11 06:17:33
合計ジャッジ時間 5,416 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
74,632 KB
testcase_01 AC 115 ms
74,372 KB
testcase_02 AC 118 ms
74,772 KB
testcase_03 AC 114 ms
74,560 KB
testcase_04 AC 114 ms
74,688 KB
testcase_05 AC 112 ms
74,660 KB
testcase_06 AC 114 ms
74,836 KB
testcase_07 AC 230 ms
81,740 KB
testcase_08 AC 227 ms
81,560 KB
testcase_09 AC 219 ms
81,400 KB
testcase_10 AC 129 ms
79,024 KB
testcase_11 AC 122 ms
78,972 KB
testcase_12 AC 217 ms
81,728 KB
testcase_13 AC 215 ms
81,804 KB
testcase_14 AC 215 ms
81,780 KB
testcase_15 AC 128 ms
79,044 KB
testcase_16 AC 128 ms
78,880 KB
testcase_17 AC 127 ms
79,064 KB
testcase_18 AC 129 ms
79,012 KB
testcase_19 AC 129 ms
79,036 KB
testcase_20 AC 130 ms
79,008 KB
testcase_21 AC 156 ms
79,520 KB
testcase_22 AC 114 ms
74,552 KB
testcase_23 AC 147 ms
79,600 KB
testcase_24 AC 131 ms
79,140 KB
testcase_25 AC 136 ms
79,352 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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)
0