...Is here. It is always nice to hear other's approaches as well.
# | User | Rating |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3831 |
3 | Radewoosh | 3646 |
4 | jqdai0815 | 3620 |
4 | Benq | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | gamegame | 3386 |
10 | ksun48 | 3373 |
# | User | Contrib. |
---|---|---|
1 | cry | 164 |
1 | maomao90 | 164 |
3 | Um_nik | 163 |
4 | atcoder_official | 160 |
5 | -is-this-fft- | 158 |
6 | awoo | 157 |
7 | adamant | 156 |
8 | TheScrasse | 154 |
8 | nor | 154 |
10 | Dominater069 | 153 |
...Is here. It is always nice to hear other's approaches as well.
Name |
---|
There is a another solution using Interval Tree.
let's T[v] == 1 if number v is inside the black box, otherwise T[v] == 0
Using array T we can construct interval tree.
Each node will contain basis vectors of existing numbers in it's range.
Initially Array T is filled with 0.
Adding number v, means T[v] = 1
Deleting number v, means T[v] = 0
After each operation we need to update only log(n) nodes.
Can you try to explain a little bit more in detail? I read the article above but I'm having some troubles understanding your solution (and quite honestly the article's) since I'm not familiar with that greedy that solves the static problem. But well, could you provide some more detailed explanation of yours?
I've sent stupid solution and got almost all points (131.71)
Idea is: have a set with current basis and set of others.
Light operations:
Add, delete from others
Heavy operation:
delete from basis.(We should check if there are any element in others that we can add to basis — deleted element. It's O(others_size) but to make it a bit random (More random elements go to current basis, so it's harder to remove them and not element from others) I support an iterator to the set of others and check all element of others in order [iter, end), then [begin, iter), not [begin, end) but I am not sure if it helped at all (probably just check from begin to end will work too)
That a thing why I don't really like contests with not full solutions getting points.
I have similar solution (n*30*30) and got AC. Idea is to keep basis with most long-living elements.
Am I right that your solution is basically offline and you precalculated for each element when it'll be deleted?
PS: I don't see you in top of scoreboard. Did you sent it after the end of contest?
Yes, my solution is offline. Yes, during the contest I had bug =)