結果

問題 No.2225 Treasure Searching Rod (Easy)
ユーザー prussian_coderprussian_coder
提出日時 2023-02-24 21:30:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 153 ms / 2,000 ms
コード長 404 bytes
コンパイル時間 281 ms
コンパイル使用メモリ 87,004 KB
実行使用メモリ 77,732 KB
最終ジャッジ日時 2023-10-11 05:51:23
合計ジャッジ時間 4,472 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,308 KB
testcase_01 AC 74 ms
71,428 KB
testcase_02 AC 72 ms
71,124 KB
testcase_03 AC 74 ms
71,328 KB
testcase_04 AC 76 ms
71,364 KB
testcase_05 AC 73 ms
71,368 KB
testcase_06 AC 73 ms
71,116 KB
testcase_07 AC 152 ms
77,472 KB
testcase_08 AC 151 ms
77,648 KB
testcase_09 AC 150 ms
77,676 KB
testcase_10 AC 131 ms
76,432 KB
testcase_11 AC 128 ms
76,440 KB
testcase_12 AC 153 ms
77,732 KB
testcase_13 AC 152 ms
77,564 KB
testcase_14 AC 152 ms
77,648 KB
testcase_15 AC 133 ms
76,436 KB
testcase_16 AC 135 ms
76,808 KB
testcase_17 AC 135 ms
76,660 KB
testcase_18 AC 136 ms
76,600 KB
testcase_19 AC 136 ms
76,564 KB
testcase_20 AC 134 ms
76,456 KB
testcase_21 AC 109 ms
76,620 KB
testcase_22 AC 73 ms
71,268 KB
testcase_23 AC 107 ms
76,560 KB
testcase_24 AC 110 ms
76,716 KB
testcase_25 AC 94 ms
76,200 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

H,W,K=map(int,input().split())
S=[[0 for _ in range(W)] for _ in range(H)]
for i in range(K):
    a,b,c=map(int,input().split())
    S[a-1][b-1]+=c
    
ans=0
mod=998244353
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:
                    ans+=S[x][y]
                    ans%=mod
print(ans)                
0