結果

問題 No.2225 Treasure Searching Rod (Easy)
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2023-02-24 21:50:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 160 ms / 2,000 ms
コード長 388 bytes
コンパイル時間 301 ms
コンパイル使用メモリ 87,024 KB
実行使用メモリ 77,664 KB
最終ジャッジ日時 2023-10-11 06:08:41
合計ジャッジ時間 4,551 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,324 KB
testcase_01 AC 74 ms
70,968 KB
testcase_02 AC 73 ms
70,992 KB
testcase_03 AC 73 ms
71,396 KB
testcase_04 AC 73 ms
71,164 KB
testcase_05 AC 75 ms
71,236 KB
testcase_06 AC 74 ms
71,104 KB
testcase_07 AC 160 ms
77,460 KB
testcase_08 AC 158 ms
77,596 KB
testcase_09 AC 153 ms
77,500 KB
testcase_10 AC 126 ms
76,400 KB
testcase_11 AC 126 ms
76,172 KB
testcase_12 AC 152 ms
77,572 KB
testcase_13 AC 153 ms
77,564 KB
testcase_14 AC 153 ms
77,664 KB
testcase_15 AC 136 ms
76,600 KB
testcase_16 AC 134 ms
76,548 KB
testcase_17 AC 135 ms
76,396 KB
testcase_18 AC 136 ms
76,428 KB
testcase_19 AC 136 ms
76,480 KB
testcase_20 AC 137 ms
76,484 KB
testcase_21 AC 110 ms
76,496 KB
testcase_22 AC 74 ms
71,112 KB
testcase_23 AC 108 ms
76,660 KB
testcase_24 AC 111 ms
76,436 KB
testcase_25 AC 96 ms
76,608 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

h,w,k = map(int,input().split())
g = [[0]*w for i in range(h)]
for i in range(k):
    x,y,v = map(int,input().split())
    g[x-1][y-1] = v


mod = 998244353

ans = 0
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 += g[x][y]
                    ans %= mod
print(ans)
0