結果

問題 No.2225 Treasure Searching Rod (Easy)
ユーザー ニックネームニックネーム
提出日時 2023-02-24 21:29:39
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 168 ms / 2,000 ms
コード長 459 bytes
コンパイル時間 295 ms
コンパイル使用メモリ 87,116 KB
実行使用メモリ 78,212 KB
最終ジャッジ日時 2023-10-11 05:51:01
合計ジャッジ時間 4,722 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,240 KB
testcase_01 AC 75 ms
71,012 KB
testcase_02 AC 76 ms
70,964 KB
testcase_03 AC 74 ms
71,112 KB
testcase_04 AC 75 ms
71,236 KB
testcase_05 AC 73 ms
71,324 KB
testcase_06 AC 76 ms
71,144 KB
testcase_07 AC 166 ms
78,192 KB
testcase_08 AC 167 ms
77,940 KB
testcase_09 AC 166 ms
77,996 KB
testcase_10 AC 139 ms
77,044 KB
testcase_11 AC 139 ms
76,908 KB
testcase_12 AC 164 ms
77,992 KB
testcase_13 AC 166 ms
78,212 KB
testcase_14 AC 168 ms
78,020 KB
testcase_15 AC 140 ms
77,168 KB
testcase_16 AC 140 ms
76,848 KB
testcase_17 AC 142 ms
76,984 KB
testcase_18 AC 142 ms
76,868 KB
testcase_19 AC 142 ms
76,876 KB
testcase_20 AC 141 ms
76,848 KB
testcase_21 AC 121 ms
77,400 KB
testcase_22 AC 75 ms
71,116 KB
testcase_23 AC 118 ms
77,256 KB
testcase_24 AC 113 ms
76,552 KB
testcase_25 AC 101 ms
76,356 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

h,w,k = map(int,input().split())
xyv = {}
for _ in range(k):
    x,y,v = map(int,input().split())
    xyv[(x-1,y-1)] = v
c = [[0]*w for _ in range(h)]
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:
                    c[x][y] += 1
ans = 0
for x in range(h):
    for y in range(w):
        if (x,y) in xyv:
            ans += xyv[(x,y)]*c[x][y]
print(ans%998244353)
0