-
-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add range_chmin_chmax_add_range_sum #257
Add range_chmin_chmax_add_range_sum #257
Conversation
長さ $N$ の整数列 $a_0, a_1, \dots, a_{N - 1}$ が与えられる。 | ||
|
||
- `0 $l$ $r$ $b$ $c$`: 各 $i = l, l+1, \dots, {r - 1}$ について、$a_i = b \times a_i + c$ | ||
- `1 $l$ $r$`: $\sum_{i = l}^{r - 1} a_i \bmod {{param MOD}}$ を出力する。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
多分コピペ元を消し忘れてます
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修正しました
ありがとうございます! 見ます |
|
argv[1]を直接使うのは問題ないです
大丈夫です、実はどちらもあんまり気にしてないです(最悪includeをちょっといじれば変更できるはずなので) |
int t = gen.uniform(0, 3); | ||
int l, r; | ||
tie(l, r) = gen.uniform_pair(0, n - 1); | ||
r++; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(0, n)?(さっきの #253 )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修正しました (small.cpp
だけ修正して他を忘れていました)
見ました、マージします ありがとうございます! |
いやよく見たら実行時間がすごいことになっています N <= 200,000の方が良さそう(もうマージしましたが…) |
手元で1.8秒とかだったから気にしてなかったが3秒を越えるのはつらそう 🙇 |
あれ、結構CI遅いんですね(手元が速い?) |
CIが遅いのでなくて手元は速いはずです (新しめのデスクトップ機を使っています) |
close #243
作りました。
argv[1]
の値を使ってたりするので、まずかったら止めてください。correct.cpp
の正当性はnaive.cpp
の他に https://tjkendev.github.io/procon-library/cpp/range_query/segment_tree_beats_2.html を使って確認しています。