Can someone make tutorial on Morbius inversion?
# | User | Rating |
---|---|---|
1 | tourist | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 170 |
2 | Um_nik | 162 |
3 | maomao90 | 161 |
4 | atcoder_official | 160 |
5 | djm03178 | 158 |
5 | -is-this-fft- | 158 |
7 | adamant | 154 |
7 | Dominater069 | 154 |
9 | awoo | 152 |
9 | luogu_official | 152 |
Can someone make tutorial on Morbius inversion?
primitive rootprimitive rootprimitive rootprimitive rootHello, Codeforces users. I started to learn NTT (i already know FFT and can implement it). But my code is not working for 998244353, but it works well for smaller modules, like 7340033 and 65537.
Here is my code: https://paste.ubuntu.com/p/QdKYCPMx3F/
P stands for power of 2. For example: 998244353 = 119 * 2 ^ 23 + 1. R stand for primitive root.
UPD:
Problem was in primitive root, for module 998244353 primitive root is 3, so powers of 3 goes through all values from 1 to 998244352 in some order. But in my implementation i needed such R that powers of R goes through all values from 1 to 2^23. In order to perform this i need to take 3^119 as R.
Hello, about 4 months ago i tried to solve 678F - Лена и запросы using LI Chao tree and trick to delete lines from it(trick), but got WA9. After that i stopped trying to solve it. But today i started from the very beginning and still it is WA9. Here is my last submission: 100175660. Can you help me?
UPD: I finally found where was an error. I used pointer incorrectly, here is solution that works: 100181898. If someone else is facing same problem try to write your update like this:
node* upd(pll val, node *v = r, ll tl = -inf, ll tr = inf) {
if (v == nullptr)
v = new node();
ll tm = tl + tr >> 1;
if (v->val.F * tm + v->val.S <= val.F * tm + val.S) {
s.push({v, v->val});
swap(val, v->val);
}
if (tl + 1 == tr)
return v;
if (v->val.F * tl + v->val.S >= val.F * tl + val.S)
v->r = upd(val, v->r, tm, tr);
else
v->l = upd(val, v->l, tl, tm);
return v;
}
In solution with an error i made upd as a void function, i think that i need to improve my understanding of pointers in C++.
Name |
---|