...Is here. It is always nice to hear other's approaches as well.
# | User | Rating |
---|---|---|
1 | tourist | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 161 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | awoo | 154 |
8 | Dominater069 | 154 |
10 | nor | 150 |
...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 =)