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

Автор awoo, история, 3 года назад, По-русски

1657A - Целочисленные действия

Идея: BledDest

Разбор
Решение (Neon)

1657B - XY последовательность

Идея: adedalic

Разбор
Решение (adedalic)

1657C - Удаление скобочной последовательности

Идея: BledDest

Разбор
Решение (vovuh)

1657D - Для геймеров. От геймеров.

Идея: BledDest

Разбор
Решение (awoo)

1657E - Минимальная покрывающая звездочка

Идея: BledDest

Разбор
Решение (awoo)

1657F - Слова на дереве

Идея: BledDest

Разбор
Решение (awoo)
  • Проголосовать: нравится
  • +119
  • Проголосовать: не нравится

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

If you are/were getting a WA/RE verdict on problems from this contest, you can get the smallest possible counter example for your submission on cfstress.com. To do that, click on the relevant problem's link below, add your submission ID, and edit the table to increase/decrease the constraints.

If you are not able to find a counter example even after changing the parameters, reply to this thread, mentioning the contest_id, problem_index and submission_id.

»
3 года назад, # |
Rev. 2   Проголосовать: нравится -41 Проголосовать: не нравится

video solution in Hindi -problem A Integer moves

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

BledDest thank you for such an interesting and good task D. I hope there will be more similar tasks

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

Update:-I got it from the editorial thank u authors.

can someone please explain me the problem e i m unable to get it from the editorial.

Thanks in advance.

»
3 года назад, # |
Rev. 2   Проголосовать: нравится +1 Проголосовать: не нравится

There are two different $$$k$$$ in the editorial of E.

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

    awoo, please if you can make me understand the second part of the editorial of problem E (I am very much confused about the k's in the editorial ) and how the answer is written in dp[k][n] like we have n not k vertices. It is actually written the opposite (I think so) so please can you make me understand what is actually happening in the DP part of the editorial(how actually things are working) and what the two k's are? Seen the implementation but of not much help. Sorry if i am making it long.

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

      BledDest and awoo the editorial and the implementation in problem E are totally different can anyone please explain what's happening in implementation motivated from editorial.

      • »
        »
        »
        »
        22 месяца назад, # ^ |
        Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

        This two ways of solution looks different but the implementation just swapped j and t in the tutorial above. The writer uses some functions to make coding easier and I think is not so difficult to understand this implementation.

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

I can't understand this line from the D's tutorial. Can anyone help? You can see that for each cost c we can only leave one unit type of that price that has the largest value of d⋅h. Let's call it bstc. Thank you, in advance.

  • »
    »
    3 года назад, # ^ |
    Rev. 2   Проголосовать: нравится +4 Проголосовать: не нравится

    suppose we have warriors h1,d1,c and h2, d2, c. They have the same cost. In this case we can pick one which have greater h * d and discard another from consideration. In other words for each 1 <= c <= C we can keep max 1 warrior with highest d * h

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

E is very beautiful! Thank you.

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

In problem C, if we give the input : 5 ((((( the expected answer ACC to editorial is 2 1. However, I feel it should be 1 0 because it is already a palindrome and it will take only 1 operation to delete it. Can someone kindly point out where's the flaw in my thinking process?

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

in case of problem A if I choose point 20,23 how can i reach their in 2 moves?

»
18 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Greedy algo for F (that might just be a special case of 2sat in the end? idk):

Dumb greedy: Place a string, then dfs to its intersecting string neighbors and try to fix those, and so on.

But this isn't correct: if you look at the cases where for a string $$$S$$$, flipping its neighbor $$$T$$$ both ways both work, then the algorithm can't decide which way to fix $$$T$$$.

But if flipping $$$T$$$ both ways works, that must necessarily mean that the nodes at $$$T \cap S$$$ are fixed letters. So just don't consider nodes with fixed letters as intersecting anymore; two strings are only intersecting if they share a node s.t. two letters are possible.

Now you can actually make the binary choice at each intersection, so greedy string fixing dfs works.

Time complexity is still $$$\widetilde{\mathcal{O}}(n + q + \sum_i^q|s_j|)$$$

The idea is similar to this problem

Implementation here, could be a lot cleaner.