Hi there!
Today at 04:00 MSK will be held Topcoder SRM 659.
Let's discuss problems after contest.
Editorial for problems.
# | 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 |
Hi there!
Today at 04:00 MSK will be held Topcoder SRM 659.
Let's discuss problems after contest.
Editorial for problems.
Name |
---|
Is there anyone who solved Div. 1 Medium with complexity better than O(n * 3m)?
Sure, O(nm2m).
Wait, can you actually make that pass?
Edit: Ignore that, it is discussed in the editorial blog.
Can you please explain any of the states that have been discussed in the editorial?
I find it easier to think in terms of a n × m grid. You are supposed to place a 1 × 2 tile or 1 × 1 tile or cover two cells of the same colour in adjacent rows, and we have to find the number of ways to tile the grid. You just run across the grid in row-wise order choosing how the next cell is tiled. If we choose the special tiling(same colour in adjacent rows), then we have to remember to not tile the next occurrence of this colour(that is, the occurence in the next row). So, it is natural to keep a set(a bitmask) of the colours that we have to ignore as we run across. So, the dp state is (x, y, colours that you ignore). Now, if the next cell is one of the colours that I ignore, update the set and continue forward. Otherwise, we choose how to tile the current cell. If it is going to be tiled by a 1 × 1 tile, you continue forward. If it is a special tile, you update the set asking to ignore the next occurrence of this colour. Finally, if it is a 1 × 2 tile, you have to make sure that the next 2 cells(the current one and the next one) are in the same row and that you cannot ignore the next 2 cells. If so, tile that way. Check out Endagorion's clear implementation for the same.
Thanks for your amazing explanation!
Does anyone know where can I find topcoder SRM editorials? I searched exhaustively with no success.
http://apps.topcoder.com/wiki/display/tc/Algorithm+Problem+Set+Analysis
I found this page but I was getting an error when I tried to login to see it. Now I logged in on another page and could access it. But thanks anyway!