結果

問題 No.2225 Treasure Searching Rod (Easy)
ユーザー pluto77pluto77
提出日時 2023-04-26 13:55:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 115 ms / 2,000 ms
コード長 295 bytes
コンパイル時間 229 ms
コンパイル使用メモリ 82,116 KB
実行使用メモリ 76,540 KB
最終ジャッジ日時 2024-04-27 17:23:16
合計ジャッジ時間 3,015 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
53,684 KB
testcase_01 AC 36 ms
52,276 KB
testcase_02 AC 37 ms
52,268 KB
testcase_03 AC 34 ms
52,672 KB
testcase_04 AC 34 ms
52,196 KB
testcase_05 AC 33 ms
52,896 KB
testcase_06 AC 32 ms
52,072 KB
testcase_07 AC 105 ms
76,120 KB
testcase_08 AC 109 ms
76,540 KB
testcase_09 AC 115 ms
76,208 KB
testcase_10 AC 86 ms
69,936 KB
testcase_11 AC 82 ms
70,228 KB
testcase_12 AC 115 ms
76,176 KB
testcase_13 AC 113 ms
76,436 KB
testcase_14 AC 111 ms
76,100 KB
testcase_15 AC 88 ms
69,756 KB
testcase_16 AC 91 ms
70,372 KB
testcase_17 AC 91 ms
70,928 KB
testcase_18 AC 92 ms
69,888 KB
testcase_19 AC 95 ms
69,624 KB
testcase_20 AC 88 ms
70,240 KB
testcase_21 AC 65 ms
68,768 KB
testcase_22 AC 33 ms
52,752 KB
testcase_23 AC 64 ms
69,780 KB
testcase_24 AC 66 ms
66,932 KB
testcase_25 AC 52 ms
64,932 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod=998244353
h,w,k=map(int,input().split())
a=[[0]*w for i in range(h)]
for i in range(k):
 x,y,v=map(int,input().split())
 a[x-1][y-1]=v
res=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:
     res=(res+a[x][y])%mod
print(res)
0