結果
問題 | No.2229 Treasure Searching Rod (Hard) |
ユーザー |
|
提出日時 | 2023-02-24 23:51:44 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 226 ms / 2,000 ms |
コード長 | 362 bytes |
コンパイル時間 | 650 ms |
コンパイル使用メモリ | 82,164 KB |
実行使用メモリ | 91,892 KB |
最終ジャッジ日時 | 2024-09-13 06:13:57 |
合計ジャッジ時間 | 6,502 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 29 |
ソースコード
h,w,k = map(int,input().split())ans = 0mod =998244353now = 1xx = [0]for i in range(2*10**5):xx.append(xx[-1] + now)now += 2now %= modfor i in range(k):x,y,v = map(int,input().split())cnt = xx[x]lcnt = max(0,x-y)rcnt = max(0, x-(w-y+1))cnt -= lcnt*(lcnt+1)//2 + rcnt*(rcnt+1)//2cnt %= modans += v * cntans %= modprint(ans)