# | User | Rating |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3823 |
3 | Benq | 3738 |
4 | Radewoosh | 3633 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3390 |
10 | gamegame | 3386 |
# | User | Contrib. |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 157 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
9 | nor | 153 |
Name |
---|
double post
This amazing moment when you see a solution below and realize that you have no idea how to generate a vector of 2.5k elements at TopCoder Arena T_T
solution
The same here :D
I used GeoGebra trying to generate a pattern that never lead to collinear but failed on that.
at a moment I thought that no test case will contains 2.5k input and brute force will pass I'm curious to know such big test cases.
I have actually managed to squeeze N^3 solution under time limit: http://pastebin.com/e6NDEj0q
but couldn't get all the bit juggling right during the contest time :)
And when you look at simplicity of Petr's solution after such efforts, it's jaw-dropping :)
Any ideas on div1 hard?
I had an idea that is based on writing down the basic equations and then noticing that, for instance, the part that depends on the cursor can be isolated since everything is additive:
So, $f(m,i)=f(m)+d_i$, where
So $f(m)$ seems to only depend on the number of set bits in m, and can be calculated via Gauss elimination. BUT that is not quite true, because if m = 0 or m = 2n - 1, then f(m, i) = 0 and we have to adjust for that. There is probably a way to derive the adjustment (it can be separated since everything is additive) from the mask, but I couldn't find it. There is also the possibility that I went completely the wrong way about it. There are some solutions in practice room but I didn't read them thoroughly and don't know if they're correct or not.
Indeed, f(m) only depends on the number of bits set in m. The trick to deal with the bits = 0 or bits = n cases is to overcount, then remove what you overcounted.
That is, for every combination of toggles that ends in position i, you will overcount the number of moves by di. So if we know, based on the starting position, what is the probability that the last bit toggled is i (let this probability be pi), then we can calculate f(m, i) normally and subtract at the end.
Ah, that makes sense. And that probability can be calculated by noticing that the only thing that matters is whether the bit i is set, and how many other bits are set, so we can reduce the number of states to 2·n and use Gauss elimination again.
Is there a problem in Arena I can't login
There was an announcement about maintenance before it went down.
Thanks
UPD it works now
tourist has the highest rating on topcoder too after this srm .
Here's my analysis of this round: http://www.rivsoft.net/blog/srm-641/