結果

問題 No.2225 Treasure Searching Rod (Easy)
ユーザー 👑 timitimi
提出日時 2023-02-24 21:37:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 166 ms / 2,000 ms
コード長 353 bytes
コンパイル時間 287 ms
コンパイル使用メモリ 86,976 KB
実行使用メモリ 77,944 KB
最終ジャッジ日時 2023-10-11 05:57:38
合計ジャッジ時間 4,626 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,144 KB
testcase_01 AC 75 ms
71,328 KB
testcase_02 AC 74 ms
71,452 KB
testcase_03 AC 74 ms
71,280 KB
testcase_04 AC 73 ms
71,308 KB
testcase_05 AC 74 ms
71,448 KB
testcase_06 AC 73 ms
71,348 KB
testcase_07 AC 164 ms
77,916 KB
testcase_08 AC 166 ms
77,944 KB
testcase_09 AC 156 ms
77,860 KB
testcase_10 AC 141 ms
77,140 KB
testcase_11 AC 143 ms
77,080 KB
testcase_12 AC 159 ms
77,872 KB
testcase_13 AC 160 ms
77,944 KB
testcase_14 AC 158 ms
77,924 KB
testcase_15 AC 134 ms
77,080 KB
testcase_16 AC 133 ms
76,988 KB
testcase_17 AC 133 ms
76,944 KB
testcase_18 AC 133 ms
76,940 KB
testcase_19 AC 134 ms
77,148 KB
testcase_20 AC 133 ms
76,944 KB
testcase_21 AC 115 ms
76,508 KB
testcase_22 AC 73 ms
71,468 KB
testcase_23 AC 114 ms
77,300 KB
testcase_24 AC 112 ms
76,496 KB
testcase_25 AC 98 ms
76,512 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

H,W,K=map(int, input().split())
mod=998244353 
A=[[0]*W for _ in range(H)]
for i in range(K):
  x,y,v=map(int, input().split())
  x-=1
  y-=1
  A[x][y]=v 
ans=0
for h in range(H):
  for w in range(W):
    for hh in range(H):
      for ww in range(W):
        if hh+ww>=h+w and hh-ww>=h-w:
          ans+=A[hh][ww]
          ans%=mod
print(ans)          
0