結果

問題 No.2225 Treasure Searching Rod (Easy)
ユーザー n_nan_na
提出日時 2023-02-24 22:54:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 167 ms / 2,000 ms
コード長 400 bytes
コンパイル時間 315 ms
コンパイル使用メモリ 86,900 KB
実行使用メモリ 78,036 KB
最終ジャッジ日時 2023-10-11 06:44:30
合計ジャッジ時間 4,802 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,460 KB
testcase_01 AC 75 ms
71,132 KB
testcase_02 AC 73 ms
71,244 KB
testcase_03 AC 73 ms
71,244 KB
testcase_04 AC 74 ms
71,124 KB
testcase_05 AC 73 ms
71,240 KB
testcase_06 AC 73 ms
71,324 KB
testcase_07 AC 162 ms
77,944 KB
testcase_08 AC 158 ms
78,036 KB
testcase_09 AC 167 ms
77,864 KB
testcase_10 AC 143 ms
77,192 KB
testcase_11 AC 142 ms
77,032 KB
testcase_12 AC 164 ms
77,952 KB
testcase_13 AC 164 ms
77,940 KB
testcase_14 AC 164 ms
77,972 KB
testcase_15 AC 136 ms
77,032 KB
testcase_16 AC 134 ms
77,068 KB
testcase_17 AC 138 ms
77,116 KB
testcase_18 AC 136 ms
76,792 KB
testcase_19 AC 136 ms
77,232 KB
testcase_20 AC 137 ms
77,060 KB
testcase_21 AC 117 ms
76,716 KB
testcase_22 AC 74 ms
71,392 KB
testcase_23 AC 114 ms
77,116 KB
testcase_24 AC 115 ms
76,556 KB
testcase_25 AC 99 ms
76,700 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 998244353
H,W,K = map(int,input().split())

G = [[0]*W for _ in range(H)]
for _ in range(K):
    y,x,v = map(int,input().split())
    G[y-1][x-1] = v

res = 0
for i in range(H):
    for j in range(W):
        for y in range(H):
            for x in range(W):
                if (y+x >= i+j) and (y-x) >= (i-j):
                    res += G[y][x]
                    res %= MOD

print(res)

    
0