結果

問題 No.2225 Treasure Searching Rod (Easy)
ユーザー 👑 KazunKazun
提出日時 2023-02-24 21:24:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 157 ms / 2,000 ms
コード長 486 bytes
コンパイル時間 299 ms
コンパイル使用メモリ 87,060 KB
実行使用メモリ 77,556 KB
最終ジャッジ日時 2023-10-11 05:45:39
合計ジャッジ時間 4,704 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,316 KB
testcase_01 AC 76 ms
71,324 KB
testcase_02 AC 73 ms
71,168 KB
testcase_03 AC 75 ms
70,984 KB
testcase_04 AC 77 ms
71,404 KB
testcase_05 AC 77 ms
71,208 KB
testcase_06 AC 75 ms
71,200 KB
testcase_07 AC 155 ms
77,556 KB
testcase_08 AC 154 ms
77,392 KB
testcase_09 AC 155 ms
77,156 KB
testcase_10 AC 132 ms
76,544 KB
testcase_11 AC 131 ms
76,344 KB
testcase_12 AC 153 ms
77,220 KB
testcase_13 AC 156 ms
77,500 KB
testcase_14 AC 157 ms
77,548 KB
testcase_15 AC 135 ms
76,216 KB
testcase_16 AC 136 ms
76,220 KB
testcase_17 AC 133 ms
76,188 KB
testcase_18 AC 135 ms
76,536 KB
testcase_19 AC 134 ms
76,508 KB
testcase_20 AC 133 ms
76,520 KB
testcase_21 AC 110 ms
76,616 KB
testcase_22 AC 76 ms
71,208 KB
testcase_23 AC 110 ms
76,612 KB
testcase_24 AC 114 ms
76,732 KB
testcase_25 AC 97 ms
76,124 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve():
    H,W,K=map(int,input().split())

    T=[[0]*(W+1) for _ in range(H+1)]
    for k in range(K):
        x,y,v=map(int,input().split())
        T[x][y]=v

    Ans=0
    for i in range(1,H+1):
        for j in range(1,W+1):
            for x in range(1,H+1):
                for y in range(1,W+1):
                    if x+y>=i+j and x-y>=i-j:
                        Ans+=T[x][y]
    return Ans%998244353

#==================================================
print(solve())
0