結果

問題 No.2225 Treasure Searching Rod (Easy)
ユーザー AngrySadEightAngrySadEight
提出日時 2022-12-09 00:34:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 131 ms / 2,000 ms
コード長 379 bytes
コンパイル時間 418 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 75,540 KB
最終ジャッジ日時 2024-04-22 18:48:28
合計ジャッジ時間 2,906 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
52,096 KB
testcase_01 AC 37 ms
51,968 KB
testcase_02 AC 36 ms
52,096 KB
testcase_03 AC 36 ms
51,456 KB
testcase_04 AC 37 ms
52,352 KB
testcase_05 AC 37 ms
51,712 KB
testcase_06 AC 37 ms
51,840 KB
testcase_07 AC 130 ms
75,036 KB
testcase_08 AC 131 ms
75,128 KB
testcase_09 AC 126 ms
75,264 KB
testcase_10 AC 49 ms
62,208 KB
testcase_11 AC 43 ms
59,520 KB
testcase_12 AC 126 ms
75,264 KB
testcase_13 AC 129 ms
75,540 KB
testcase_14 AC 129 ms
75,388 KB
testcase_15 AC 43 ms
60,160 KB
testcase_16 AC 44 ms
60,416 KB
testcase_17 AC 45 ms
60,160 KB
testcase_18 AC 44 ms
60,160 KB
testcase_19 AC 47 ms
60,672 KB
testcase_20 AC 43 ms
60,032 KB
testcase_21 AC 68 ms
65,024 KB
testcase_22 AC 37 ms
52,608 KB
testcase_23 AC 67 ms
65,664 KB
testcase_24 AC 50 ms
62,080 KB
testcase_25 AC 54 ms
62,720 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

H, W, K = map(int, input().split())
x = []
y = []
v = []
for i in range(K):
    X, Y, V = map(int, input().split())
    x.append(X - 1)
    y.append(Y - 1)
    v.append(V)
ans = 0
mod = 998244353

for i in range(H):
    for j in range(W):
        for k in range(K):
            if x[k] + y[k] >= i + j and x[k] - y[k] >= i - j:
                ans = (ans + v[k]) % mod
print(ans)
0