結果

問題 No.2225 Treasure Searching Rod (Easy)
ユーザー miya145592miya145592
提出日時 2023-05-04 01:57:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 136 ms / 2,000 ms
コード長 444 bytes
コンパイル時間 289 ms
コンパイル使用メモリ 82,060 KB
実行使用メモリ 77,440 KB
最終ジャッジ日時 2024-05-01 18:07:27
合計ジャッジ時間 3,780 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
52,096 KB
testcase_01 AC 40 ms
52,096 KB
testcase_02 AC 40 ms
52,096 KB
testcase_03 AC 40 ms
52,480 KB
testcase_04 AC 41 ms
51,840 KB
testcase_05 AC 39 ms
52,304 KB
testcase_06 AC 40 ms
52,096 KB
testcase_07 AC 134 ms
76,976 KB
testcase_08 AC 135 ms
76,796 KB
testcase_09 AC 136 ms
76,928 KB
testcase_10 AC 109 ms
72,960 KB
testcase_11 AC 111 ms
72,704 KB
testcase_12 AC 132 ms
76,924 KB
testcase_13 AC 132 ms
77,192 KB
testcase_14 AC 133 ms
77,440 KB
testcase_15 AC 105 ms
73,088 KB
testcase_16 AC 105 ms
72,960 KB
testcase_17 AC 105 ms
73,216 KB
testcase_18 AC 107 ms
72,704 KB
testcase_19 AC 104 ms
72,960 KB
testcase_20 AC 104 ms
72,704 KB
testcase_21 AC 86 ms
73,416 KB
testcase_22 AC 43 ms
51,880 KB
testcase_23 AC 85 ms
73,728 KB
testcase_24 AC 88 ms
70,784 KB
testcase_25 AC 68 ms
67,968 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 998244353
H, W, K = map(int, input().split())
xyv = [list(map(int, input().split())) for _ in range(K)]
field = [[0 for _ in range(W)] for _ in range(H)]
for x, y, v in xyv:
    x-=1
    y-=1
    field[x][y] = v
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+=field[x][y]
                    ans%=MOD
print(ans)
0