結果

問題 No.2225 Treasure Searching Rod (Easy)
ユーザー AngrySadEightAngrySadEight
提出日時 2022-12-09 00:33:32
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 379 bytes
コンパイル時間 229 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-04-22 18:48:24
合計ジャッジ時間 15,547 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
10,752 KB
testcase_01 AC 28 ms
10,880 KB
testcase_02 AC 27 ms
10,752 KB
testcase_03 AC 28 ms
10,624 KB
testcase_04 AC 27 ms
10,880 KB
testcase_05 AC 27 ms
10,752 KB
testcase_06 AC 28 ms
10,752 KB
testcase_07 TLE -
testcase_08 TLE -
testcase_09 TLE -
testcase_10 AC 83 ms
10,752 KB
testcase_11 AC 30 ms
10,752 KB
testcase_12 TLE -
testcase_13 TLE -
testcase_14 TLE -
testcase_15 AC 32 ms
10,752 KB
testcase_16 AC 32 ms
10,752 KB
testcase_17 AC 31 ms
10,752 KB
testcase_18 AC 31 ms
10,752 KB
testcase_19 AC 32 ms
10,752 KB
testcase_20 AC 31 ms
10,752 KB
testcase_21 AC 372 ms
10,752 KB
testcase_22 AC 28 ms
10,880 KB
testcase_23 AC 342 ms
10,752 KB
testcase_24 AC 92 ms
10,752 KB
testcase_25 AC 112 ms
10,752 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