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

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

Hi,

I would like to invite you to Kyoto University Programming Contest (KUPC), which will be held on 2 Oct. (4:00 — 9:00 GMT). Problem writers consist of several students in Kyoto University. The contest will be held on AtCoder.

Contest Link

The contest duration is 5 hours, and there will be 11 problems. KUPC has been held every year for about 5 years in Japan, but this is the first time to provide English problem statements.

I participated in the test round of this contest. The first a few problems are easy, so I'm sure everyone can enjoy the contest. On the other hand, a few problems from the last are probably interesting and though enough for high rated coders. We hope lots of people will compete in our contest. Good luck and have fun.

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

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

As far as I know, KUPC has been one of the most intetesting contests in Japan. I believe this year's KUPC will be even more enjoyable. So I highly recommend you to participate in the contest :)))) Don't miss it!

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

Is it rated? I can't find anything in the blog or the contest link.

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

Will there be editorials?

If not, how to solve anything starting from Problem E. :)

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

Wondering how to solve problem E

I thought that for goats close enough(|dx| ≤ 2 and |dy| ≤ 2), the optimal solution would be the convex hull of surrounding points of these goats. And convex hull shall be caculated respectively for goat flocks (am I right using flock?) far away. But it was wrong. This solution even passed less data points than another solution calculating convex hull for all goats.

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

    Ok after reading someone's code, I think I get the idea (not sure if it's complete) :

    Construct a flow graph where the outer layer of the grid (i.e. the area around the grid, outside the grid) is the source, and the Xs are sinks. Let the empty squares has capacity 1 and the Xs has capacity . Also, there is an edge from a square to an adjacent square with capacity . Now, the maximum flow of this graph is the answer.

    I think this is true because otherwise there would be an augmenting path from the source to sink, so the sheeps can escape.

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

      Another construction of flow graph I learned from other's code is like this:

      There's a source src and a sink dst.

      For every cell in the input, there's two vertices, say, ui and vi, where i is the id of the cell, H * W at most. (You can imagine they are two copies of layer of the input)

      For every 'X', there are two edges: One connecting src and ui with capacity inf. Another connecting ui and vi with capacity inf.

      For every '.', there is an edge connecting ui and vi with capacity 1.

      For every cell that is on the border of the input, there is an edge connecting vi and dst with capacity inf.

      For every cell whose id is i, there are edges connecting its neighbours back from vi to uj with capacity inf, where j is the id of its neighbours.

      But I still can't understand why minimum cut(or maximum flow) is the answer. Though there is some intuition, I can not convince myself about this...

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

Any ideas on how to solve G? I couldn't figure out how to use the second condition.

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

    The condition is confusing, but the solution isn't: just take all distinct substrings of length L (for the best L).

    To prove this, note that the second condition on strings of equal length is just "the strings are different", and if there is any smaller substring in the set, you don't lose anything by adding characters to the beginning or end of it, as you're only making it harder for the second condition to be violated.

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

I see people with short solutions for H. What is the correct idea to solve the problem?

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

I might be missing something really obvious but I can't come up with a proof for the solution to C. Can somebody kindly help me out? The solution I 'guessed' was to just use Y=127 every time.

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

    The parity of the number of times each bit is set in the final set of numbers is fixed.

    This means that any solution that has more bits set in a position than your solution has at least 2 more bits set in that position, which is impossible since in your solution at most one bit is not set in each position (the one from the number which is not 127).

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

FYI The editorial is out (in Japanese though) : link

It would be nice if someone could explain editorials for HIJK (got stuck halfway using Google Translate)