結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
52,096 KB
testcase_01 AC 33 ms
52,096 KB
testcase_02 AC 33 ms
52,224 KB
testcase_03 AC 34 ms
51,840 KB
testcase_04 AC 33 ms
52,096 KB
testcase_05 AC 34 ms
52,096 KB
testcase_06 AC 35 ms
51,968 KB
testcase_07 AC 105 ms
76,100 KB
testcase_08 AC 112 ms
76,364 KB
testcase_09 AC 117 ms
76,160 KB
testcase_10 AC 86 ms
69,408 KB
testcase_11 AC 82 ms
69,248 KB
testcase_12 AC 113 ms
76,452 KB
testcase_13 AC 113 ms
76,008 KB
testcase_14 AC 114 ms
76,396 KB
testcase_15 AC 94 ms
69,376 KB
testcase_16 AC 93 ms
69,760 KB
testcase_17 AC 91 ms
70,016 KB
testcase_18 AC 91 ms
69,632 KB
testcase_19 AC 94 ms
69,376 KB
testcase_20 AC 91 ms
69,632 KB
testcase_21 AC 64 ms
68,608 KB
testcase_22 AC 33 ms
52,096 KB
testcase_23 AC 64 ms
68,992 KB
testcase_24 AC 65 ms
67,072 KB
testcase_25 AC 53 ms
64,784 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