# | User | Rating |
---|---|---|
1 | tourist | 3985 |
2 | jiangly | 3741 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3489 |
7 | Radewoosh | 3483 |
8 | Kevin114514 | 3442 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
2 | atcoder_official | 162 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | awoo | 154 |
8 | Dominater069 | 154 |
10 | nor | 150 |
Name |
---|
I don't usually do this for sample answers (but quite often, I realize that I should have spent more time analyzing samples before thinking about the solution, so I am not a good example).
But my modulo struct, when printing value to debug, tries to represent it as a rational number with a small numerator/denominator. This helps debugging quite a lot and I really recommend everyone adding similar stuff to their template.
Makes sense :) One thing I discovered while writing my blogpost is that instead of doing
you can do (sorry, can't write Rust)
Which might allow you to raise MAX to around sqrt(modulo), where the collisions start.
Or even
to handle small negative fractions as well
Nice!
Though I am not sure how often it is helpful to know that your number is rational with a denominator of around several thousand (except for cases like in your blog, when it is a power of two or some other reasonable number).
I agree, but still multiplication using a for loop and division looks weird ;)
69 minutes lololol
I didn't. I've tried to use this trick a few times in the past, but it never worked, so I thought it was useless and removed it from my mind. Actually, I didn't even remember about this trick when checking the samples.