Блог пользователя chokudai

Автор chokudai, история, 5 лет назад, По-английски

We will hold UNICORN Programming Contest 2021(AtCoder Beginner Contest 225).

The point values will be 100-200-300-400-500-500-600-600.

We are looking forward to your participation!

  • Проголосовать: нравится
  • +81
  • Проголосовать: не нравится

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Codeforces Problem C
Got this Problem at tha last moment of Contest. i think it can help for problem F

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +9 Проголосовать: не нравится

Hints for E? No editorial published for it.

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

I'm wondering why double gets WA and long double gets AC in problem E. Did anyone encounter the same case as I did?

I found the angles for each pair of (x,y-1) (x-1,y) and treated them as segments. Then I used greedy to find the max number of non overlapping segments.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +16 Проголосовать: не нравится

Any hints for problem G? Thanks a lot.

  • »
    »
    5 лет назад, скрыть # ^ |
    Rev. 2  
    Проголосовать: нравится +11 Проголосовать: не нравится
    Hint
  • »
    »
    5 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +24 Проголосовать: не нравится
    1
    2
    3
    4
    • »
      »
      »
      5 лет назад, скрыть # ^ |
       
      Проголосовать: нравится +8 Проголосовать: не нравится

      I don't get it. Why/how does this work?

      • »
        »
        »
        »
        5 лет назад, скрыть # ^ |
         
        Проголосовать: нравится +11 Проголосовать: не нравится
        Spoiler

        This is the construction I learned from the solution to the "maximum density subset problem". You might be able to find some resources on it if you google.

      • »
        »
        »
        »
        5 лет назад, скрыть # ^ |
        Rev. 6  
        Проголосовать: нравится +11 Проголосовать: не нравится

        Here's another way to explain the same solution:

        Spoiler
»
5 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

Lost stupid amounts of time on D due to output requiring a length descriptor. My fault for forgetting how to read again, but still annoying nonetheless... probably should've focused on E rather than continually trying wrong things on F in the time remaining... will have to find out in upsolve though.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

how to solve problem D using DSU?

  • »
    »
    5 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +3 Проголосовать: не нравится

    Graphs alone are enough for D. To perform the first and second types of queries efficiently, we can use multisets instead of vectors for the adjacency list. Then we can build 2 graphs(the second graph will be a reversed graph of the first graph), one contains edges from y -> x and the other one contains edges from x -> y. To answer the third query, we can run a DFS on the first graph to find the deepest reachable node(say 'root' node) from node x, then run another DFS on the second graph starting from the 'source' node and print all the nodes we visit one by one.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

My solution for C was based on the idea that all numbers in the same row would differ by 1 and all numbers in the same column would differ by 7... But I am getting WA on 5 test cases. Anyone got any idea why?

Link to my submission https://atcoder.jp/contests/abc225/submissions/26968319

»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Sorry for necroposting, but I can't think of any better place to ask this.

In problem G, are there any solutions without max flows? I found a really neat idea that if we consider a chessboard coloring of the grid and rotate everything by 45 degrees we get 2 independent grids: one with black squares and the other with white squares (here new cells are adjacent if original cells were diagonally adjacent).

Now it is really easy to see that it is always optimal to only mark complete subrectangles in each grid, so one thing we can do is $$$O(n^5)$$$ subrectangle dp, which is too slow with long longs even after considering the low constant factor.

It's a cool idea and it's sad that it probably doesn't have a continuation.