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

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

APIO 2016 (Asia-Pacific Informatics Olympiad) will take place in 7-9 may 2016 hosted by Republic of Korea .
official site . competition rules .

Practice session will start at 3 May and end in 5 May .
wish good luck for all participants .
UPD : practice session has been started , Link.
UPD2 : contest has been started and it will end at 8 May 11 GMT. UPD3 : open contest day has been ended

Problems : problem 1 , problem 2, problem 3
UPD4 :Official results
congratulation for all medals winners
first place : yokozuna57 and namonakiaccount
second place : yutaka1999

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

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

Auto comment: topic has been updated by Whistle (previous revision, new revision, compare).

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

Can I participate ? I'm not in Informatics Olympiad

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

Really liked A :)

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

The problems in the practice session are from BOI2014.

http://www.boi2014.lmio.lt/

https://github.com/boi-2014/tasks

gl & hf;

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

30 submission max allowed on each problem, and max one submission in 5 minutes. Isn't that too much? :/

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

    In worst case you will submit 60 codes :/ (the sum of allowed submissions is 90 !) .

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

      in 5 minutes you can submit 3 submissions ,one for each problem
      so in worst case you will submit 60 codes for every problem and it's allowed only for 30

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

Please don't share problems/codes/solutions/scores here or anywhere else until the end of the contest that will make the contest unfair.

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

How much points are needed to get silver?

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

how do you get beyond subtask 2 of fireworks?

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

    Let me guess you got 100+26+100 ?

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

      Nope. 31+26+100=157. I am bad at math so I couldn't solve boat.

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

        Can you explain your solution for the third problem ?

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

          So we first do one query from 0...INF to "bound" the range, i.e. know the smallest and largest number. This costs N+1.

          Let's say the smallest number is X and the largest number is Y. Note that there are N-2 numbers from [X+1, Y-1]. So we split this segment into approximately equal (can be off by 1) N-1 pieces, each of about length (Y-X-1)/(N-1).

          By pigeonhole principle, one of these segments must be empty right? So the largest gap will not be any smaller than a single segment size, so that rules out any gaps within a segment to be the largest.

          So we can just compare gaps in between segments and find the largest among them.

          As an example, if the query results are: (1, 5) (-1) (-1) (17, 20) (23, 23)

          We will just compare the gaps of 5-17 and 20-23. This will give you the largest gap no matter what.

          Since there are N-1 segments, and the total number of elements queried is N-1, the total points used is

          (N+1) for initial query + (N-1) queries + (N-1) total elements = 3N-1 < 3N.

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

      My teammate got 100 — 26 — 100. minh141198

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

      Looks you are very curious. SO what's your score?

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

    Subtask 3 (hard one) : the tree dp in ST2 can be expressed in a combination of linear function (like CHT). you should modify it while moving up to parent, and "add" two function in merging step. Details omitted (cause I don't know it too.) for ST4 I think merging from small -> large idea will help.

    Subtask 3 (easy one) : I "guess" (I have no proof) that, in one of the optimal way, the explosion time is one of the depth of leaf node. Now, we can modify the tree dp in ST2. (I need sliding window for this)

    I come up with that "easy one" in last 10 minutes, so I couldn't even submit it. Use this solution at your own risk.

    My score : 100-26-100. (Top in Korea, Dongwook Hwang (Inhibitor) have same score with me too.)

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

      easy one : MY GUESS IS WRONG. countercase :

      2 5
      1 1
      1 299
      1 299
      2 300
      2 300
      2 300
      

      answer is 300 -> 2, while all leaf have 299 / 301 depth. It's even hard to get 255..

      (Thanks gs12117 for informing this!)

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

      The dp procedure is something like Minkowski sums. And after some observation it's possible to maintain all the points where slope of the function changes, simply using std::set (handwrite BST is not necessary), merging from small to large, which gives an O(nlog^2 n) solution. (I wrote this and got 100pts) And it's easy to find that there are only "extract max" operation needed, so if you replace std::set by leftist trees you will get an O(nlogn) solution.

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

        I still don't understand what are you storing in each dp state? How does the function look like?

        Please elaborate further :)

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

        Thanks for your reply :) I will read it after thinking more.

        (seems like you participated unofficially, right?)

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

      Cool, looks like q2 was actually the hard question. Funny that was the only question I solved.

      My score: 9-100-30

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

    You think in terms of a cost function for each subtree. Then you realize it is always a convex function (have a region of global minimum in the middle, and gradient >= 1 everywhere else). You just propagate this up the tree, and done.

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

      Can you explain what you did in bigger detail ? How did you calculate the cost function efficiently ?

      How do you merge 2 cost functions?

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

        The cost function is the cost of adjusting the subtree such that the path to each leaf is equal.

        We need to support 2 important operations:

        1. Send a cost function up a tree

        2. Merge cost functions of subtrees (that have already been sent up their edge)

        For 2. we can store our cost function as points where the gradient changes (a point for each +1), in a sbbst, along with the initial (at 0) gradient and intercept. Merging them is simply adding the initial gradient and intercept, and merging the bsts, which could be done efficiently using the small merge principle.

        1. involves choosing how much to change the edge we are going up. Notice that as long as we can't change the subtree for free (i.e. move around at the optimum), it is more optimal to change the single edge as much as possible. Let len be the length of the edge, not changing the edge at all would result in the function shifted right by len. However, for everywhere left of the optimum, we will try to use the edge as much as possible, thus it is shifted left and up by len. Everywhere right of the optimum we can increase the edge by however much we want, thus it's always gradient 1. Therefore, the net result is that the optimum is shifted right by len, everything left of the optimum is shifted up by len, and they are connected with gradient 1. In our representation, the net result is simpler: intercept+=len, the two points at the ends of the optimum shifts right by len, and all points after the optimum are deleted.

        By using this algorithm to propagate the function up the tree, we can easily find the optimum at the root.

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

    How to solve 2nd subtask?

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

Did anybody score 100 in fireworks?

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

I scored 9 + 26 + 48.18 :(
What do you think will be the medals limits?

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

when does apio deliver medals?

or do they give medals at all?

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

    They usually give medal certificates to country leaders in IOI.

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

    Why don't they give medals anyway?!

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

      They don't have a ceremony or anything like that, simply the deputy leader of team of the host country carries all certificates with him and gives them to other deputy leaders and that's it basically.

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

    I was thinking of getting a nice medal and then i saw this comment :(

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

Примерно с 84 — бронза, с 138 — серебро, с 215 — золото

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

Full solution for subtask 2 P3 :

Step 1 : Find a_1 and a_n

Query(0, 10^{18}) to get the values of a_1 and a_n. This increases M to N + 1.

Now, divide the range [a_1 + 1, a_n — 1] into n — 1 equal blocks. Since there are n — 2 elements in the range but there are n — 1 blocks, at least one block is empty. So, if we let D be the distance for one block, then the answer is > D. So, we know that the answer will not be the difference of two elements in the same block.

Now, we just go from the start (a_1), and query each of the blocks to get its min and max element (if they exist) and update the maximum difference accordingly. Since we do N — 1 queries and there're N — 2 numbers involved in the queries, the total value of M is N + 1 + N — 1 + N — 2 = 3N — 2 < 3N.

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

Where are the unofficial results ?

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

Unofficial Medal Cutoffs :

Bronze : 87

Silver : 138

Gold : 215.04

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

Help debug — https://ideone.com/oOKjFC. For "gap"

It says that it terminated with a nonzero exist code, which means that in one of my inputs, my s is larger than my t, but I don't see this happening...

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

Auto comment: topic has been updated by Whistle (previous revision, new revision, compare).

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

I scored 55 points in fireworks, but it took me too much time.

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

Competition data (tasks, tests, solutions) are uploaded in apio2016.org

You can also find it in Github : https://github.com/apio-2016/apio2016-tasks

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

Why are the unofficial results not published yet?

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

    it only passed to delegation leaders.

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

      Why is it only passed to delegation leaders, then?

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

        It's the unofficial results, just for teams to check if there were any mistakes in their scores (compared to the score they received in contest).

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

          I just don't equate "unofficial" with "hidden", especially when part of it (cutoffs) is published/leaked and when it's even listed in the schedule.

          If it's supposed to be secret, this discussion wasn't supposed to exist at all. If it's not, why not publish it with a note saying "unofficial results"?

          UPD: Wow, all those downvotes — logic must make some people really butthurt.

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

            I guess, delegation leaders get a list with points of their state participants only. There should be no other information regarding others' scores or medal distribution. This procedure is needed for the appeal, if the scores turn out to be somehow wrong. Personally, i think leak of medal cutoffs is not due to the unofficial results, there might as well be other sources.

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

              Actually our delegation leader sent a list that contain all participants. If our leader have a permission to see list, it should what planned to do. So we know cutoffs due to unoffical results, BTW cutoffs aren't "leak", we can just see it.

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

            IMHO, list isn't secret, they just didn't think to publish unoffical one, BTW I don't know that's the reason.

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

    So now that every delegation leader knows the results and medal cutoffs. Why the delay with posting official results?!

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

Official Result is available: http://apio2016.org/results/

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

Results are finally out. Yay! http://apio2016.org/results/

Boat has 31 full scorers, Fireworks has 4 full scorers, Gap has 40 full scorers. (Correct me if I counted wrong)

Korean top6 :

Jaehyun Koo (ko_osaga) (100 / 26 / 100)

Dongwook Hwang (Inhibitor) (100 / 26 / 100)

Donghyun Kim (kdh9949) (100 / 26 / 49.72)

Hyunsoo Kim (khsoo01) (31 / 26 / 100)

Sunjay Oh (ggoh) (31 / 26 / 100)

Junseo Koo (31 / 7 / 100)

Also congratulations to Ultimate tonyjjw !

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

I know I'm going to get downvoted to oblivion, but I really think this is unfair. Scoring 80-86.5 is much harder than scoring 87. :(

I know both are bad anyway

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

Did teams from Russia participate in APIO 2016?

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

    By APIO rules, all contestants should participate onsite. We were not able to satisfy this condition, so participated only unofficially. Our top results are 226 from SpyCheese and josdas.