Ormlis's blog

By Ormlis, history, 5 hours ago, translation, In English

Thank you for participating!

2024A - Profitable Interest Rate was authored and prepared by Helen Andreeva with Artyom123

2024B - Buying Lemonade was authored by Endagorion and prepared by sevlll777

2023A - Concatenation of Arrays was authored and prepared by Mangooste

2023B - Skipping was authored and prepared by adepteXiao

2023C - C+K+S was authored and prepared by yunetive29

2023D - Many Games was authored and prepared by Tikhon228

2023E - Tree of Life idea by isaf27, solution and preparation by Ormlis

2023F - Hills and Pits was authored and prepared by glebustim with vaaven

Tutorial is loading...
Tutorial is loading...
Tutorial is loading...
Tutorial is loading...
Tutorial is loading...
Tutorial is loading...
Tutorial is loading...
Tutorial is loading...
  • Vote: I like it
  • +52
  • Vote: I do not like it

»
5 hours ago, # |
  Vote: I like it +16 Vote: I do not like it

Ormlis when will hidden test case and source code of others be visible?

  • »
    »
    4 hours ago, # ^ |
      Vote: I like it +3 Vote: I do not like it

    Only administrators can do this, not me.

    • »
      »
      »
      4 hours ago, # ^ |
      Rev. 2   Vote: I like it +4 Vote: I do not like it

      Oh sorry I didn't know. Btw great contest Thank you

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

Hi, I cannot prove my solution for div1D nor hack it I hope someone can hack or prove it.

Spoiler
»
5 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

i swear i can't figure out for the life of me why my solution to B isn't correct, and i'm not allowed to look at the failing test case either.

Spoiler
  • »
    »
    4 hours ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    I dont know about the formulas, but you should use long long instead of int.

  • »
    »
    4 hours ago, # ^ |
    Rev. 2   Vote: I like it +1 Vote: I do not like it

    Bro your code won't return any output if k is equal to sum of all elements of the array.

    Try

    1

    3 6

    1 2 3

    Comment if you want me to fix it

»
4 hours ago, # |
Rev. 3   Vote: I like it 0 Vote: I do not like it

then $$$c_p \cdot q^{c_p} > (c_p - 1) \cdot q^{c_p - 1}$$$; otherwise, the smallest element can definitely be removed.

why?

»
4 hours ago, # |
  Vote: I like it -6 Vote: I do not like it

C is a piece of dogShit,i mean why it had to be based on some crap observation.It could have been improved by giving a formal proof of why does that always work. Disappointed...

  • »
    »
    3 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    What's wrong with the proof provided?

  • »
    »
    2 hours ago, # ^ |
      Vote: I like it +3 Vote: I do not like it

    Another solution is to sort the arrays by comparing pairs $$$(min(a_{i,1}, a_{i,2}), max(a_{i,1},a_{i,2}))$$$. We can observe that if we move the array with minimal element to the left (and among these with the least maximum), the number of inversions cannot increase, so that's optimal order

»
30 minutes ago, # |
  Vote: I like it 0 Vote: I do not like it

Ormlis In D2C, how can we solve the problem for arrays of sizes three or more? I tried to solve it by comparing inversions of ab and ba for sorting but it seems this condition is not transitive and thus doesn't work for arrays of twos either, so I had to use some other min/max technique, which doesn't seem to generalise for sizes more than 2.

»
26 minutes ago, # |
  Vote: I like it +1 Vote: I do not like it

got IGM but still cannot solve A during contest, isn't weird?

  • »
    »
    1 minute ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    A simpler solution for 1E:

    When you choose a node as the root node, our answer is at least $$$\sum_{i=1}^n \frac12 s_i(s_i-1)$$$, where $$$s_i$$$ is the number of children of node $$$i$$$.

    However, such a construction may not be able to satisfy some edges that pass through both the son and father at the same time. Let's consider the contribution of this situation to increasing the answer.

    We set a dp state $$$f_i$$$ to represent the number of residual paths that can be uploaded through the parent when the node $$$i$$$ calculates the necessary contribution internally (i.e., the above equation).

    Transfer as follows:

    $$$f_u = \sum_{v\in son_u} \max(1 - [u\text{ is root}], f_v - (s_u - 1))$$$

    After calculating $$$f_ {root}$$$, we must pair the extra paths pairwise, and when we choose the node with the highest degree as the root, we can prove that there must be a match to make the scheme valid:

    [tbd, prove is hard]

    So we can calculate $$$f_ {root}$$$ and add it to the equation at the beginning.

    using translator.

    287001804

    code