結果

問題 No.2229 Treasure Searching Rod (Hard)
ユーザー ニックネームニックネーム
提出日時 2023-02-24 22:42:45
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 980 ms / 2,000 ms
コード長 211 bytes
コンパイル時間 118 ms
コンパイル使用メモリ 10,516 KB
実行使用メモリ 7,964 KB
最終ジャッジ日時 2023-10-11 06:37:30
合計ジャッジ時間 19,960 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,960 KB
testcase_01 AC 15 ms
7,896 KB
testcase_02 AC 15 ms
7,868 KB
testcase_03 AC 15 ms
7,896 KB
testcase_04 AC 15 ms
7,848 KB
testcase_05 AC 15 ms
7,836 KB
testcase_06 AC 15 ms
7,956 KB
testcase_07 AC 891 ms
7,840 KB
testcase_08 AC 976 ms
7,784 KB
testcase_09 AC 931 ms
7,760 KB
testcase_10 AC 898 ms
7,800 KB
testcase_11 AC 898 ms
7,964 KB
testcase_12 AC 487 ms
7,764 KB
testcase_13 AC 474 ms
7,844 KB
testcase_14 AC 479 ms
7,940 KB
testcase_15 AC 969 ms
7,916 KB
testcase_16 AC 969 ms
7,856 KB
testcase_17 AC 980 ms
7,804 KB
testcase_18 AC 969 ms
7,828 KB
testcase_19 AC 963 ms
7,780 KB
testcase_20 AC 962 ms
7,824 KB
testcase_21 AC 960 ms
7,848 KB
testcase_22 AC 978 ms
7,944 KB
testcase_23 AC 389 ms
7,768 KB
testcase_24 AC 497 ms
7,840 KB
testcase_25 AC 577 ms
7,840 KB
testcase_26 AC 236 ms
7,828 KB
testcase_27 AC 86 ms
7,824 KB
testcase_28 AC 789 ms
7,840 KB
testcase_29 AC 739 ms
7,904 KB
testcase_30 AC 115 ms
7,836 KB
testcase_31 AC 212 ms
7,840 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

h,w,k = map(int,input().split())
mod = 998244353; ans = 0
for _ in range(k):
    x,y,v = map(int,input().split())
    ans += ((max(x-y+1,1)+x)*min(x,y)//2+(x-1+max(x-w+y,1))*min(x-1,w-y)//2)*v%mod
print(ans%mod)
0