chokudai's blog

By chokudai, history, 6 years ago, In English

We will hold AtCoder Beginner Contest 183.

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

We are looking forward to your participation!

  • Vote: I like it
  • +39
  • Vote: I do not like it

| Write comment?
»
6 years ago, hide # |
 
Vote: I like it +6 Vote: I do not like it

Feature request: give us the possibility to unsubscribe from email notifications about particular contests (ABC/ARC/AGC). I don't want to miss AGC and now it means getting several other emails a month.

»
6 years ago, hide # |
Rev. 2  
Vote: I like it +5 Vote: I do not like it

How to solve F!

Here my code, but it gave TLE in 4 test cases

tle code
  • »
    »
    6 years ago, hide # ^ |
     
    Vote: I like it +6 Vote: I do not like it

    Think of small to large merge operations. For each student maintain a set of all distinct classes in his group , and while merging in dsu, take the smaller set and merge it to the larger set. Also maintain a map<pair,int> to store the answer of the queries (a,b). implementation

  • »
    »
    6 years ago, hide # ^ |
    Rev. 3  
    Vote: I like it +8 Vote: I do not like it

    Disjoint Set union with 2d Map. The idea is similar to the one explained in this blog, [Explanation] dsu on trees (small to large).

    my code
  • »
    »
    6 years ago, hide # ^ |
    Rev. 4  
    Vote: I like it 0 Vote: I do not like it

    Your solution's time compexity will be $$$O(n^2)$$$.

    For example, '1 i i+1' for i in $$$[1, n - 1]$$$. In this case, your solution will merge a set with size i to another set with size 1 each time.

    When merge two sets, just merge smaller set to bigger set, the time complexity will reduce to $$$O(n \log n)$$$.

»
6 years ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

For the first time i think F was so easy in Atcoder Beginner and also for the first time i was able to solve F in ABC. but then couldn't solve B(:.

»
6 years ago, hide # |
 
Vote: I like it +8 Vote: I do not like it

Am I the only who think most of problems were standard?

»
6 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

How to solve problem F?, I tried with DSU but then ran into memory issues.

»
6 years ago, hide # |
 
Vote: I like it +33 Vote: I do not like it

Every time someone sets a brain-dead problem with DSU, somewhere in the world a kitten dies.

»
6 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

How to solve B problem?

»
6 years ago, hide # |
 
Vote: I like it +19 Vote: I do not like it

For those interested, I posted an unofficial English editorial at https://mirror.codeforces.com/blog/entry/84653

»
6 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

How to solve D ? I sorted the segments by left point and tried to solve using two pointer starting form right . It gave 5 test cases WA.

  • »
    »
    6 years ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    D is a very standard interval/event management problem.

    Code
»
6 years ago, hide # |
Rev. 2  
Vote: I like it -19 Vote: I do not like it

I tried E with some precomputation.My time complexity is O(N^2). 5 pass.But it failed the test case 11.

»
6 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

How do you convert transitions in E from $$$O(N)$$$ to $$$O(1)$$$ in an easy way? What's the usual style guide to follow? It was an easy and fun problem. I wasn't able to implement the summing up of dp values of rows, cols and diagonals in an easy way that accommodates stopping at a wall (which is done in $$$O(N)$$$ making my solution cubic; would TLE).

  • »
    »
    6 years ago, hide # ^ |
     
    Vote: I like it +3 Vote: I do not like it

    partial sum

    • »
      »
      »
      6 years ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      I figured you had to do that (and I tried it). But, how do I take care of the sum once I hit a wall?

      • »
        »
        »
        »
        6 years ago, hide # ^ |
         
        Vote: I like it 0 Vote: I do not like it

        Nevermind, I'm stupid. I made it more complicated that it should have been. Sorry for disturbing sare.

      • »
        »
        »
        »
        6 years ago, hide # ^ |
         
        Vote: I like it +5 Vote: I do not like it

        You should have 3 array. Let's call them psum_row, psum_col, psum_dia. And if there is a wall in cell (i, j) then just all of psum_row[i][j], psum_col[i][j], psum_dia[i][j]will be equal to 0. code

      • »
        »
        »
        »
        6 years ago, hide # ^ |
         
        Vote: I like it +8 Vote: I do not like it
        code
»
6 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

How to solve E? my code

»
6 years ago, hide # |
 
Vote: I like it +10 Vote: I do not like it

Video editorial. It was my first time to record a video editorial, hope you guys enjoy it.

»
6 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

How to solve F?

I use segment tree merge to solve it.And it runs fast.But I think it is not a good solution.What is the simple solution?

»
6 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Can you tell how to solve D when the P is not litre per minute but total litre required? (All constrains being same or even tighter if possible)

I thought it that way and tried sorting all points and then using a priority queue to give the new hot water to the interval with least end point among all active interval, not knowing the time complexity.