# | User | Rating |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3821 |
3 | Benq | 3736 |
4 | Radewoosh | 3631 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3388 |
10 | gamegame | 3386 |
# | User | Contrib. |
---|---|---|
1 | cry | 164 |
1 | maomao90 | 164 |
3 | Um_nik | 163 |
4 | atcoder_official | 161 |
5 | -is-this-fft- | 158 |
6 | awoo | 157 |
7 | adamant | 156 |
8 | TheScrasse | 154 |
8 | nor | 154 |
10 | Dominater069 | 153 |
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.