結果

問題 No.2225 Treasure Searching Rod (Easy)
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2023-02-24 21:26:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 178 ms / 2,000 ms
コード長 366 bytes
コンパイル時間 298 ms
コンパイル使用メモリ 87,056 KB
実行使用メモリ 76,956 KB
最終ジャッジ日時 2023-10-11 05:47:51
合計ジャッジ時間 4,084 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,524 KB
testcase_01 AC 73 ms
71,300 KB
testcase_02 AC 72 ms
71,320 KB
testcase_03 AC 73 ms
71,416 KB
testcase_04 AC 71 ms
71,324 KB
testcase_05 AC 73 ms
71,340 KB
testcase_06 AC 73 ms
71,324 KB
testcase_07 AC 177 ms
76,920 KB
testcase_08 AC 178 ms
76,780 KB
testcase_09 AC 173 ms
76,920 KB
testcase_10 AC 81 ms
75,912 KB
testcase_11 AC 77 ms
75,876 KB
testcase_12 AC 169 ms
76,956 KB
testcase_13 AC 170 ms
76,860 KB
testcase_14 AC 165 ms
76,668 KB
testcase_15 AC 80 ms
76,144 KB
testcase_16 AC 79 ms
76,056 KB
testcase_17 AC 80 ms
76,016 KB
testcase_18 AC 79 ms
75,936 KB
testcase_19 AC 78 ms
75,924 KB
testcase_20 AC 80 ms
76,016 KB
testcase_21 AC 98 ms
75,984 KB
testcase_22 AC 73 ms
71,168 KB
testcase_23 AC 95 ms
76,092 KB
testcase_24 AC 83 ms
76,080 KB
testcase_25 AC 86 ms
76,080 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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)

    
0