結果

問題 No.2225 Treasure Searching Rod (Easy)
ユーザー ikomaikoma
提出日時 2023-02-24 21:33:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 168 ms / 2,000 ms
コード長 392 bytes
コンパイル時間 297 ms
コンパイル使用メモリ 87,040 KB
実行使用メモリ 78,056 KB
最終ジャッジ日時 2023-10-11 05:54:16
合計ジャッジ時間 4,794 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,216 KB
testcase_01 AC 76 ms
71,152 KB
testcase_02 AC 75 ms
70,992 KB
testcase_03 AC 74 ms
71,180 KB
testcase_04 AC 75 ms
70,852 KB
testcase_05 AC 74 ms
71,036 KB
testcase_06 AC 75 ms
71,372 KB
testcase_07 AC 166 ms
78,056 KB
testcase_08 AC 162 ms
77,960 KB
testcase_09 AC 168 ms
77,928 KB
testcase_10 AC 137 ms
77,176 KB
testcase_11 AC 134 ms
77,116 KB
testcase_12 AC 166 ms
77,860 KB
testcase_13 AC 164 ms
77,860 KB
testcase_14 AC 164 ms
77,884 KB
testcase_15 AC 149 ms
77,028 KB
testcase_16 AC 148 ms
77,120 KB
testcase_17 AC 148 ms
77,020 KB
testcase_18 AC 148 ms
76,784 KB
testcase_19 AC 145 ms
76,948 KB
testcase_20 AC 146 ms
77,036 KB
testcase_21 AC 125 ms
77,320 KB
testcase_22 AC 75 ms
71,292 KB
testcase_23 AC 118 ms
77,376 KB
testcase_24 AC 116 ms
76,440 KB
testcase_25 AC 105 ms
76,300 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

H,W,K=map(int,input().split())
XYV=[list(map(int,input().split())) for _ in range(K)]
Map = [[0]*W for _ in range(H)]
for x,y,v in XYV:
    Map[x-1][y-1]=v
MOD=998244353
ans=0
for i in range(H):
    for j in range(W):
        for x in range(H):
            for y in range(W):
                if i+j<=x+y and i-j<=x-y:
                    ans+=Map[x][y]
                    ans%=MOD
print(ans)
0