結果

問題 No.2225 Treasure Searching Rod (Easy)
ユーザー Meso Meso
提出日時 2024-07-29 10:15:59
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 1,485 ms / 2,000 ms
コード長 465 bytes
コンパイル時間 440 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 11,136 KB
最終ジャッジ日時 2024-07-29 10:16:24
合計ジャッジ時間 23,963 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

h, w, k = map(int, input().split())

t = [[0 for _ in range(w)] for _ in range(h)]

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

ans = []
for i in range(h):
    for j in range(w):
        tmp = 0
        for x in range(h):
            for y in range(w):
                if x + y >= i + j and x - y >= i - j:
                        tmp += t[x][y]
        ans.append(tmp)
        
                        
print(sum(ans)%998244353)
0