結果

問題 No.2225 Treasure Searching Rod (Easy)
ユーザー MottchanMottchan
提出日時 2023-03-26 18:25:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 131 ms / 2,000 ms
コード長 402 bytes
コンパイル時間 183 ms
コンパイル使用メモリ 81,608 KB
実行使用メモリ 75,860 KB
最終ジャッジ日時 2023-10-19 13:48:53
合計ジャッジ時間 3,577 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,372 KB
testcase_01 AC 39 ms
53,372 KB
testcase_02 AC 38 ms
53,372 KB
testcase_03 AC 35 ms
53,372 KB
testcase_04 AC 38 ms
53,372 KB
testcase_05 AC 37 ms
53,372 KB
testcase_06 AC 35 ms
53,372 KB
testcase_07 AC 113 ms
75,844 KB
testcase_08 AC 116 ms
75,856 KB
testcase_09 AC 128 ms
75,860 KB
testcase_10 AC 88 ms
70,124 KB
testcase_11 AC 104 ms
72,200 KB
testcase_12 AC 131 ms
75,856 KB
testcase_13 AC 128 ms
75,860 KB
testcase_14 AC 124 ms
75,856 KB
testcase_15 AC 96 ms
70,124 KB
testcase_16 AC 96 ms
70,124 KB
testcase_17 AC 99 ms
70,124 KB
testcase_18 AC 100 ms
70,124 KB
testcase_19 AC 101 ms
70,124 KB
testcase_20 AC 100 ms
70,124 KB
testcase_21 AC 73 ms
68,072 KB
testcase_22 AC 38 ms
53,384 KB
testcase_23 AC 72 ms
70,256 KB
testcase_24 AC 72 ms
68,068 KB
testcase_25 AC 61 ms
66,004 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 998244353

H,W,K = map(int, input().split())
S = [[0]*W for _ in range(H)]

for i in range(K):
    x, y, v = map(int, input().split())
    S[x-1][y-1] = v

ans1=0
for i in range(H):
    for j in range(W):
        ans2 = 0
        for x in range(H):
            for y in range(W):
                if x+y >= i+j and x-y >= i-j:
                    ans2+=S[x][y]
        ans1 += ans2
print(ans1%mod)
0