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

Автор Dinar_Gumirov, 6 лет назад, перевод, По-русски

Всем привет!

Университет Иннополис проводит Азиатско-Тихоокеанскую олимпиаду по информатике (Asia-Pacific Informatics Olympiad, APIO) 2018. APIO — это онлайн олимпиада по правилам IOI для школьников из Азиатско-Тихоокеанского региона. Участие в официальном соревновании возможно через представителей олимпиадного комитета страны.

Всех желающих мы приглашаем принять участие в открытом соревновании Open Contest APIO 2018 на том же наборе задач.

Начать контест вы можете в любое удобное время, с 00:00 15 мая 2018 по 00:00 17 мая 2018 (UTC+0). Вам будет предоставлено 3 задачи и 5 часов на их решение. Условия будут доступны на русском и английском языках. Поддерживаемые языки программирования C11, C++14 and Free Pascal. Подробная информация доступна на сайте APIO2018. К сожалению, во время Open Contest не будет возможности задать вопросы по условиям.

Задачи Олимпиады подготовлены niyaznigmatul, qwerty787788, budalnik, izban, PavelKunyavskiy, pashka.

Для участия необходима предварительная регистрация по ссылке. Регистрация закроется 14 мая. После закрытия регистрации вы получите логин и пароль на электронный адрес, который указали при регистрации.

Олимпиада пройдет с использованием проверяющей системы PCMS2.

Ждем вашего участия!

Оргкомитет APIO2018

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

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

Will you publish an Editorial after end of the Olympiad?

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

    Organizing Committee won't publish an editorial after the end of the Olympiad. We will publish the tasks, tests and author's solutions on APIO2018 website.

    I will give a link for the Olympiad materials here.

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

Will test data be available after contest? Hopefully this year won't be like the last :P

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

looked for this types of challenges..thanks :D

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

Hello, I've already registered 2 days ago. But until now, I didn't get username and password for the contest. Are user and password will be given after registration closed?

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

Can those who gave APIO discuss scores if not solutions?

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

So what about the unofficial results?

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

Unofficial results?

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

I'm having a few questions about my solution. Can I post them here now?

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

So it seems that the online mirror has ended. How to solve 2nd and how to get 1st (I know how to do but it won't be fast enough for last subtask).

Also what's wrong with following solution for 3rd: Compress to bcc. If there is a bridge add esge between the two components. If there is a articular point, split the component such that the AP becomes a new component. Now we have 3 cases — the free vertices are in the same component, 2 vertices are in the same component and all 3 vertices are in different components. This can be done with a couple of DFS-es on the compressed tree. This solution passed for 66 points. Did anyone get AC with a similar idea.

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

    why do you need to split on AP btw? because.. in any case.. after creation of a bridge tree, there will be no case that is not eliminated by the bridge tree but eliminated by the AP-splitting. What i mean is.. if S,F where on different sides of AP then its all good. And even if they are on the same side, We can still go form S, through the AP(which is taken to be C) and then to F, without revisiting. if we were indeed revisiting, then that means there was only one path.. which is again a bridge, and so that case is already eliminated by the bridge tree.

    Please correct if wrong.

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

    Sorry for my poor English

    2nd problem can be solved in the following way: First, consider how to solve subtask 4(all circles have the same radius R): We can divide the Cartesian plane by square with R*R. Then, for each circle i that has not been removed yet, let's denote the circle i in block x_i, y_i. Other circles which might be removed by circle i must be in block ( x_i ± 2 , y_i ± 2 ).

    Now, let’s try to solve the whole task. Let’s denote one operation as: one circle i remove other circles in blocks ( x_i ± 2 , y_i ± 2 ). First, let’s sort the circles by the radius. Let’s divide the Cartesian plane with R = r_max. Then do the operation. If the operation had be done more than 1024 times and now the current r * 100 <= r_max. Then we set r_max = r and divide the Cartesian plane with new radius r_max again. The source of parameter 1024 and 100 is found during the contest. (If the parameter 1024 is changed to 3000 or more, it will TLE on test 88).

    I got AC on 2nd problem by the above method.

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

    Instead of dividing into R*R blocks, we can divide blocks using logs.

    Assume that at first, we have one big block, with coordinate [0,0] to [2^32, 2^32]

    At each query, we can just divide each block into 2*2 smaller block until the side of each block is as small as possible but still bigger than current R. The rest of the solution is same as yp155136's one.

    Please note that the division step can be done quickly using bitwise operator, combined with the idea of radix sort (base 2)

    By using this method, we do not need to find the "magic" value for each division.

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

    For Prob C, I got AC with an idea similar to radoslav11, however, I connect every nodes in one BCC to a virtual nodes so that I need to do DFS just one time.

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

As I said above, I have a few questions about my solution for the 1st problem.

During the contest, I came up with a O(N * log * log) solution with a segment tree where each of its node is a set. And I known that my solution was much slower than the author's one but 5 seconds for time limit made me believe that it would pass.

But not as I expected, my solution was only able to pass N < 60000 subtasks and got TLE with others. So I accepted that my solution was too slow and tried to solve the two first N < 300000 ones in O(Nlog).

And again, I got TLE. But what make me confused is I passed only one of them.

So I want to ask if the test cases for the first N < 300000 was weak and why a simple O(Nlog) solution with segment tree can not pass the problem in 5 seconds time limit. Thanks for reading.

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

    What was your approach?

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

      First of all, sorry for my poor English.

      I sorted both the stores and queries in increasing order of the year.

      In a simple approach, for each of K types of stores, we'll maintain a set of the stores and we only need to binarysearch for its closest store in the set for each query.

      Let's call the set K closest stores of K different type to the position x is s(x). Now we'll have to maintain a segment tree which can maintain min(s(x)) and max(s(x)).

      If K = 1, it would be easy to insert and delete stores from by just implementing a lazy propagation segment tree.

      If we only delete stores, we can use a max-min segment tree.

      But for the last subtask, since we only need to know the min(s(x)) and max(s(x)), for each node p on segment tree which covers the range [L, R], we'll maintain a set of stores T(p) such that if a store r is in T(p) then r is also in s(i) with every L <= i <= R. We can easily see that we don't need to perform lazy updates on this segment tree. For each inserting and deleting update on range [X, Y], we should stop going deeper inside subtree p if X <= L <= R <= Y and perform the update on T(p). Then for each asking query of postion x, we can calculate the answer with every node p such that L <= x <= R.

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

        You can actually remove the set, using 2 priority queues and 2 vectors to keep the things you should erase. This way it should be much faster. Thanks btw.

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

          Actually, I thought about that during contest, using priority queue for pair < position, the index of the store >. But since I was not able to pass the O(Nlog) one, I gave up the contest.

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

When'll the organizing committee publish the dataset ?

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

Shouldn't a N*root(N) solution pass for 30 points in problem 2? I tried it but somehow got TLE.
Code: https://pastebin.com/kC1u1tEv

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

As usual, all the tasks are ready for judging: https://oj.uz/problems/source/326

Thanks for authors providing a Polygon package, it was really helpful! We hope we could also able to upload APIO 2017 too.

UPD: We mistakenly uploaded tests wrongly (slightly wrong), and we rejudged every solution. Maybe your score has been changed. Sorry for the inconvenience caused.