結果

問題 No.2225 Treasure Searching Rod (Easy)
ユーザー HydruHydru
提出日時 2023-02-24 21:46:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 366 ms / 2,000 ms
コード長 368 bytes
コンパイル時間 300 ms
コンパイル使用メモリ 87,068 KB
実行使用メモリ 77,900 KB
最終ジャッジ日時 2023-10-11 06:03:37
合計ジャッジ時間 6,252 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,256 KB
testcase_01 AC 72 ms
71,240 KB
testcase_02 AC 73 ms
71,440 KB
testcase_03 AC 72 ms
71,264 KB
testcase_04 AC 73 ms
71,252 KB
testcase_05 AC 73 ms
71,172 KB
testcase_06 AC 72 ms
71,428 KB
testcase_07 AC 355 ms
77,828 KB
testcase_08 AC 358 ms
77,712 KB
testcase_09 AC 359 ms
77,900 KB
testcase_10 AC 191 ms
77,196 KB
testcase_11 AC 176 ms
77,012 KB
testcase_12 AC 363 ms
77,864 KB
testcase_13 AC 361 ms
77,812 KB
testcase_14 AC 366 ms
77,876 KB
testcase_15 AC 184 ms
77,136 KB
testcase_16 AC 186 ms
77,108 KB
testcase_17 AC 185 ms
77,100 KB
testcase_18 AC 186 ms
77,060 KB
testcase_19 AC 183 ms
77,400 KB
testcase_20 AC 184 ms
77,100 KB
testcase_21 AC 159 ms
77,672 KB
testcase_22 AC 74 ms
71,332 KB
testcase_23 AC 160 ms
77,456 KB
testcase_24 AC 154 ms
77,336 KB
testcase_25 AC 121 ms
77,256 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod=998244353

h,w,k=map(int,input().split())

D=dict()

for _ in range(k):
    x,y,v=map(int,input().split())
    D[(x-1,y-1)]=v

ans=0
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 and (x,y) in D:
                    ans+=D[(x,y)]
                    ans%=mod

print(ans)
0