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

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

We will hold AtCoder Grand Contest 038. This contest counts for GP30 scores.

The point values will be announced later.

We are looking forward to your participation!

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

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

So B, C, D are all worth $$$700$$$ points O_o, interesting!

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

How to solve A?

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

How to solve C

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

Thanks for the cool F! However, C is very typical.

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

    F also seemed like a typical flow problem to me.

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

      I've solved thousands of flow problems and still have no idea how to solve this one even though friends are explaining it to me for like 10 minutes already xd.

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

        You have some cycles, for each cycle you either make all $$$a_i = i$$$(first type) or $$$a_i = p_i$$$(second type), the same for $$$q$$$. The obvious idea would be to find a mincut between the cycles of the first type and the second type. But all our penalty edges are between the cycles of the same kind, so it doesn't work. But the graph is bipartite so we flip one of the parts: we take cycles of the first type in $$$p$$$ and cycles of the second type in $$$q$$$ and need to find min cut between cycles that we take and don't take.

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

    Yes C is typical, and in fact, it was not intended to set this problem. We were preparing another hard problem (which should have been F) but a significant issue arose form that task and we had to remove it. Then this C was inserted to the problem set and old CDE was moved to new DEF.

    I will try my best to avoid such cases in future contests. Anyway, thank you for taking part in the contest!

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

C: ORIGINAL PROBLAM DO NOT STEEL

A, B, D were pretty nice. D could have benefited from a bit more points (900?), it wasn't hard to implement but there's a lot of things to consider.

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

How to solve B?

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

    I believe this is the intended solution : For all subarrays in A of size L, see to it that the left element of leftmost element and right element of current subarray is lesser and larger than all the elements of current subarray, because if it is so, then we have a repeating subarray, think about it, it's just the same as previous subarray considered after sorting ? But are those all the repetitions? No! Repetitions could occur if 2 subarrays are already sorted right? To check a subarray of being sorted, check largest length till which subarray is sorted starting at that position(2 pointers kind of deal). But remember to keep 1 instance of the permutation where this kind of repetition occurs,ie,when 2 or more subarrays are sorted.

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

Failed to implement B with the sliding window so I implemented segment tree with hashes (2 bases was needed) :D

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

Can someone explain the PIE idea on E? I'm pretty confused by the editorial.

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

    As for how inclusion-exclusion is applied:

    Let's pretend we generate an infinite sequence, and find the expected value of the number of turns before all $$$B_i$$$ are reached. A turn counts toward our expected value if at least one of the following is true: before the turn, the number of $$$i$$$ in our sequence is less than $$$B_i$$$.

    Now for each turn, we can use inclusion-exclusion using these statements as events, to calculate the probability that it counts toward our sum.

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

Task C — LCMs is probably standard for a lot of people but it was new for me and I wasn't able to figure out the intuition behind the approach. The editorial is pretty unintuitive (atleast for me , like from where does those wi come from ? ) . Can someone explain the intuition behind it ?

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

I believe C can be done much simpler than in editorial, by simply determining what is $$$f(d) = \sum_{gcd(a_i, a_j) = d} a_i a_j$$$ for every $$$d$$$ explicitly. The trick is to consider values of $$$d$$$ in descending order and noting that $$$f(d) = g(d) - \sum_{k \ge 2} f(kd)$$$, where $$$g(d) = \sum_{d|a_i, a_j} a_i a_j$$$.

$$$g$$$ can be trivially determined, so can be $$$f$$$.

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

    Got it. Thanks a ton ! Btw the functions 'f' and 'g' you defined are pretty clever. I was wondering that this way we can even avoid doing mobius inversions at a lot of places if we define a such recurrences , is this true ? Are there any helpful resources to learn these or links to similar problems ? How did you learn this stuff ?

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

      I learn this stuff the hard way, by solving the same problem but with gcd instead of lcm on high school workshop and then presenting my solution with that inclusion-exclusion stuff, mobius inversion bullshit etc. and after 0,5h of explaining where all the people stopped listening long ago one guy came to board after me and showed this trick within a minute and I was like :oooo

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

        Hah, I remember trying and failing to solve this or something very similar. I didn't realise it was so simple back then, but I remembered not to make the same mistake now.

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

    Can you please explain what is g used in calculating the g(d) above. Also what do sum1, sum2 and sum_p represent in your submission your submission and how do they help in calculating sum_prods[g].

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

Are there any updates on WTF? Are you planning to increase the number of advancers? How many AGCs (or similar) are yet to be in 2019? Can you update the scores? rng_58

  • »
    »
    7 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +30 Проголосовать: не нравится
    'Are there any updates on WTF?'
    

    Probably on February next year. What information do you want to know in advance?

    'Are you planning to increase the number of advancers?'
    

    No, sorry, this year the number of advancers will be 8 again.

    'How many AGCs (or similar) are yet to be in 2019?'
    

    We are planning 12 per year, so 4 more I hope.

    'Can you update the scores?'
    

    Updated.