| # | User | Rating |
|---|---|---|
| 1 | Benq | 3792 |
| 2 | VivaciousAubergine | 3647 |
| 3 | Kevin114514 | 3611 |
| 4 | jiangly | 3583 |
| 5 | strapple | 3515 |
| 6 | tourist | 3470 |
| 7 | Radewoosh | 3415 |
| 8 | Um_nik | 3376 |
| 9 | maroonrk | 3361 |
| 10 | XVIII | 3345 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 162 |
| 2 | adamant | 148 |
| 3 | Um_nik | 146 |
| 4 | Dominater069 | 143 |
| 5 | errorgorn | 141 |
| 6 | cry | 138 |
| 7 | Proof_by_QED | 136 |
| 8 | YuukiS | 135 |
| 9 | chromate00 | 134 |
| 10 | soullless | 133 |
|
0
There is no difference between Rating and Rating(all) |
|
-9
|
|
0
Is there any detail editorial for problem I using fwt |
|
+8
|
|
0
multiply the polynomials with same degree using fast power (otherwise I got a TLE due to my slower nft template) and multiply the smallest polynomials in degree each time. |
|
0
|
|
0
Read this Code may help, Sadly the website you provided does not support C++17. |
|
0
How to solve problem B if you change $$$c_i = \gcd(b_i, b_{i + 1})$$$ |
|
+5
Thanks for Reference of |
|
0
Thanks! oh my god, stupid dna049!!! |
|
0
|
|
0
Thanks ~ |
|
0
Won't faster... sorry |
|
+10
slightly faster than origin |
|
0
So smart your link is! |
|
On
jianglyFans →
How to get recurrence formula of an array by it's generating function ?, 6 years ago
0
Auto comment: topic has been updated by jianglyFans (previous revision, new revision, compare). |
|
On
jianglyFans →
How to get recurrence formula of an array by it's generating function ?, 6 years ago
0
Auto comment: topic has been updated by jianglyFans (previous revision, new revision, compare). |
|
On
jianglyFans →
How to get recurrence formula of an array by it's generating function ?, 6 years ago
0
Auto comment: topic has been updated by jianglyFans (previous revision, new revision, compare). |
|
0
How to solve Problem E? I even don't understand the sample:
|
|
0
Amazing, provide a new idea to cost compile-time instead of exec-time ! It may useful for particluar questions since CP only care about exec-time. But: ‘constexpr’ loop iteration count has limit of 262144 (use ‘-fconstexpr-loop-limit=’ to increase the limit), and we can't use |
|
0
Amazing! |
|
0
How to compute the exact value of $$$a_n$$$ by OGF ? for example the case: the OGF of Fibonacci numbers $$$\Rightarrow F(x) = \frac{x}{1-x-x^2}$$$ Or for unkown problem, we compute the OGF of $$$a_n$$$, and find a recurrence array with same OGF of $$$a_n$$$, then use matrix power(or poly mod power) to deal with recurrence array, finally we get $$$a_n$$$. |
|
0
and then write in matrix form |
|
0
Thanks! I understand how you get the geometric sums, by calculating generating function. Really much nicer! |
|
0
|
|
0
|
|
+41
Four methods for Problem D: Method 0. using dp as the Editorial given: $$$a_i = a_{i-1} + 2 \cdot a_{i-2} + (i \% 3 == 0?4:0)$$$ (use $$$a_i$$$ instead of $$$dp_i$$$ for short) Code: 84808226
Expand the above recurrence formula we have with $$$a_0 = a_1 = a_2 = 0$$$, and $$$A$$$ indicate the coefficient matrix.
Method 1. using fast matrix power we can get $$$a_{3 \lfloor \frac{n}{3} \rfloor + 2}, a_{3 \lfloor \frac{n}{3} \rfloor + 1},a_{3 \lfloor \frac{n}{3} \rfloor}$$$, and $$$a_{3 \lfloor \frac{n}{3} \rfloor + n \% 3}$$$ is the answer Method 2. It is well known that If you know the characteristic polynomial of matrix, then you can use polynomial multiplication instead of matrix product to get $$$(a_{3n+2},a_{3n+1},a_{3n},1)^T$$$ which is faster that Method 1, especially when the size of $$$A$$$ becomes bigger. Best method in general as I know (can't use NFT, since neither size of A is big nor 1,000,000,007 is NFT-friendly.) Method 3. Note that the special $$$A$$$ can be diagonalized, thus there exist an invetible matrix $$$X$$$ such that thus we have We can calculate $$$X$$$ above by hand or using following SageMath Code: Actually we can calculate $$$A^n$$$ with only 3-lines SageMath Code: and the last column of $$$A^n$$$ is |
|
+7
Give me five I appended k zeros at the beginning and k zeros plus 1 at the end. 83967055 |
|
0
thanks for your blog! |
| Name |
|---|


