結果

問題 No.2225 Treasure Searching Rod (Easy)
ユーザー shobonvipshobonvip
提出日時 2023-02-24 21:29:27
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 160 ms / 2,000 ms
コード長 316 bytes
コンパイル時間 493 ms
コンパイル使用メモリ 87,068 KB
実行使用メモリ 77,740 KB
最終ジャッジ日時 2023-10-11 05:51:15
合計ジャッジ時間 4,723 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,112 KB
testcase_01 AC 74 ms
71,164 KB
testcase_02 AC 74 ms
71,328 KB
testcase_03 AC 75 ms
71,224 KB
testcase_04 AC 71 ms
71,212 KB
testcase_05 AC 72 ms
71,232 KB
testcase_06 AC 73 ms
71,272 KB
testcase_07 AC 160 ms
77,740 KB
testcase_08 AC 160 ms
77,516 KB
testcase_09 AC 153 ms
77,632 KB
testcase_10 AC 128 ms
76,408 KB
testcase_11 AC 126 ms
76,544 KB
testcase_12 AC 149 ms
77,708 KB
testcase_13 AC 150 ms
77,332 KB
testcase_14 AC 149 ms
77,516 KB
testcase_15 AC 134 ms
76,120 KB
testcase_16 AC 133 ms
76,572 KB
testcase_17 AC 133 ms
76,316 KB
testcase_18 AC 135 ms
76,324 KB
testcase_19 AC 135 ms
76,336 KB
testcase_20 AC 135 ms
76,440 KB
testcase_21 AC 111 ms
76,172 KB
testcase_22 AC 74 ms
71,288 KB
testcase_23 AC 107 ms
76,552 KB
testcase_24 AC 109 ms
76,428 KB
testcase_25 AC 97 ms
76,480 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

ans = 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:
					ans = (ans + a[x][y]) % mod

print(ans)
0