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

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

We will hold Japanese Student Championship 2019 Qualification. (Despite its name, the contest is open for all international participants.)

The point values will be announced later.

We are looking forward to your participation!

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

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

The Atcoder's problems usually have a very High Quality

I think the contest is the same as before

Wish everybody good luck

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

[Offtopic] Is it possible to participate in Virtual contest for previous Atcoder contests ?

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

20 mins before the contest start)

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

10 minutes left.And then the contest will begin.

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

I hope to become blue in AtCoder

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

5 more minutes!!! all the best guys!!!

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

How to solve C,I have no Idea about it...

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

Of course the atcoder contest turns into a typing race the one time I almost cut my finger off while cooking right before the contest. I could have done so much better if I didn't have to write without my left forefinger :Dd

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

MFW I read F as "N elements are sorted in non-decreasing order,"

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

How to solve problem D?

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

in problem C

changing the order of operations does not affect the result

How to prove ?

Someone explain C in simple word?Didn't get editorial!!

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

    changing the order of operations does not affect the result because what matters is the number of times we flip the color of a square(in fact just the parity of number of flips). Assume the i index is flipped even number of times then the color remains preserved. Example: S="BWWB". We flip in order (1,3) and then (2,4) the index 2 is flipped twice. Even if we change the order of operation i.e (2,4) and then (1,3) we flip index 2 twice. When we flip a color even number of times, we get the same color back irrespective of the order of operations. Similar argument for odd flips. The color is inverted irrespective of order of operations.

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

Again, author has a way other than GF to get formula for F. But it is solvable through generating function. Don't need to be creative just do like a farmer :)

Assuming the $$$(m + 1)$$$-th largest element is $$$k$$$. We need to compute the coefficient of each term $$$x^i$$$ in $$$\sum_{k = 1}^{r}{(1 - x^{k})^{n - m}x^{km}}$$$.

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

    Sorry but I don't understand how this works, can you elaborate? (I got solution similar to editorial I think).

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

      Let count the number of sequences that $$$m$$$-th $$$= k \gt $$$ $$$(m + 1)$$$-th.

      There are $$$C(n, m)$$$ ways to choose places for $$$m$$$ largest elements.

      GF for $$$m$$$ largest elements: $$$x^{km}\frac{1}{(1 - x)^m} - x^{km + m}\frac{1}{(1 - x)^m}$$$. (note that at least one element is $$$k$$$)

      GF for remaining $$$(n - m)$$$ elements: $$$\frac{(1 - x^k)^{n - m}}{(1 - x)^{n - m}}$$$.

      GF for the one more element to ensure the sum of them are fixed: $$$\frac{1}{1 - x}$$$.

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

D = IMO Shortlist 1983 Problem lol (see P1 here)

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

Problem B: Can someone explain me, please, how we get k*(k-1)/2? What is it? Why exactly k*(k-1)/2?

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

    For each element, we have two types of inversions,

    1) Inversions among it's own sequence

    2) Inversions among other sequences that are concatenated.

    For type 1), we just calculate in given sequence, in $$$O(n^2)$$$.

    For type 2), in given sequence of $$$N$$$ elements, you need to find for each element how many elements are smaller (or larger) than it ( strictly ).

    So if there are $$$x$$$ numbers smaller than some element, then in first copy of the sequence the other $$$(k-1)$$$ copies on the right will each have those x numbers. So we add $$$(k-1)*x$$$ inversions, then for the second copy of the sequence, we have $$$(k-2)$$$ copies on the right. So, this way, you will add $$$x$$$, $$$(k-1) + (k-2) + (k-3) + ... + (1) + (0)$$$ times.

    [ $$$0$$$ is for the last copy that you concatenate ].

    And $$$\sum_{i=1}^{k-1}i$$$ = $$$\frac{k*(k-1)}{2}$$$

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

I can't understand the Editorial of D. Why it is correct when the edges of same level form a bipartite graph? If there's a circle with even number of nodes,it's still a bipartite graph,but we can go back with each edge traveled exactly once.

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

In question D, I have seen many solutions and most of them first calculated xor of the node numbers and then printed least significant active bit(LSAB) as the color between those edges, can someone help me why we did this? (why we took xor & LSAB and how is it related to bipartite graph )

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

    Finding the LSAB of XOR directly translates to finding the maximum number of bits from the right which are the same. Basically, an edge in level i connects two nodes with labels such that the least significant i-1 bits are the same but the least significant ith bit is different.

    Now think about travelling edges only in level i. This means everytime you travel an edge in level i, the ith bit will keep on changing. This will never contain any odd cycles as if there were odd cycles, the first and the last element of the cycle will not be the same, which is a contradiction. Edges of level i form a bipartite graph, which is what is required.