Hello Everyone!
I Think Problem D in Div 2 RD225 = problem B in Div 1 RD225 too hard!!! because just 46 person got AC (2 person in Div 2 & 44 person in Div 1 !!)
and if you have some algorithm for this problem that got AC please share it here!
# | 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 | luogu_official | 150 |
Hello Everyone!
I Think Problem D in Div 2 RD225 = problem B in Div 1 RD225 too hard!!! because just 46 person got AC (2 person in Div 2 & 44 person in Div 1 !!)
and if you have some algorithm for this problem that got AC please share it here!
Name |
---|
It's mentioned that
My idea was:
in each row, there are "good" intervals of cells that we can get to from (1, 1)
a volcano splits a good interval into 2 (one or both possibly empty); if there's no volcano between 2 cells from different good intervals, they're merged (more generally, if we can get to some cell, we can get to all cells to its right until a volcano (or the border of the map)
simulating this process efficiently (using set<>s for non-empty good intervals) for all rows is enough for comparably large n and m; for n large, merge chunks of empty rows into one
there are at most O(m) non-empty good intervals; each volcano now leads to operations that take time; the same time is taken by merging 2 good intervals, and there are O(m) empty rows (after the above mentioned merging), so the time is
I think my idea is right but i overlooked something.
If you imagine a graph where each node is a volcane and two volcanes share an edge if they share a common point, then you only need to check if (1, 1) is cut-off from (n, n).
You do this my imagineing that walls are also nodes in the graph and checking if coresponding walls are connected.
Edit: nevermind i got it, where i was wrong.
That was my idea at first. Remember 325D - Reclamation? There was also this problem where you needed to find the smallest square such that blocking (free) cells in such square will separate the top left and bottom right corner, and it used a similar idea.
I soon found a test case where this approach failed :D
Well, my idea came from http://www.spoj.com/problems/DINOSM/
But i forgot that the guy from problem statement can only move down and right...