結果

問題 No.2225 Treasure Searching Rod (Easy)
ユーザー ああいいああいい
提出日時 2023-02-25 14:34:00
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 148 ms / 2,000 ms
コード長 389 bytes
コンパイル時間 472 ms
コンパイル使用メモリ 87,216 KB
実行使用メモリ 77,924 KB
最終ジャッジ日時 2023-10-11 12:51:29
合計ジャッジ時間 4,983 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,280 KB
testcase_01 AC 75 ms
71,148 KB
testcase_02 AC 76 ms
71,600 KB
testcase_03 AC 74 ms
71,444 KB
testcase_04 AC 74 ms
71,292 KB
testcase_05 AC 74 ms
71,184 KB
testcase_06 AC 75 ms
71,476 KB
testcase_07 AC 148 ms
77,860 KB
testcase_08 AC 146 ms
77,720 KB
testcase_09 AC 141 ms
77,860 KB
testcase_10 AC 113 ms
76,688 KB
testcase_11 AC 116 ms
76,680 KB
testcase_12 AC 141 ms
77,924 KB
testcase_13 AC 139 ms
77,712 KB
testcase_14 AC 138 ms
77,708 KB
testcase_15 AC 119 ms
76,676 KB
testcase_16 AC 121 ms
76,816 KB
testcase_17 AC 120 ms
76,560 KB
testcase_18 AC 121 ms
76,900 KB
testcase_19 AC 120 ms
76,684 KB
testcase_20 AC 118 ms
76,916 KB
testcase_21 AC 111 ms
76,900 KB
testcase_22 AC 74 ms
71,300 KB
testcase_23 AC 107 ms
76,648 KB
testcase_24 AC 103 ms
76,768 KB
testcase_25 AC 98 ms
76,636 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

for i in range(H):
    for j in range(W):
        for x in range(i,H):
            for y in range(W):
                if x + y >= i + j and x - y >= i - j:
                    ans += dat[x][y]
        ans %= P
print(ans)
0