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

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

Google Code Jam 2018 round 3 starts on Saturday, June 9th at 14:00 UTC and last 2.5 hours. Top 25 contestants will earn a trip to the final round in Toronto.

Also don't forget about Distributed Code Jam round 1, which starts a day later.

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

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

I've just noticed that I was supposed to register for Distributed Code Jam if I want to participate according to the following sentence in the email.

If you would like to participate in Distributed Code Jam, you must register here with the email address used for 2018 Code Jam registration (the one this email was sent to) by Wednesday, May 30th at 11:00 UTC.

However, I never noticed it before, and therefore didn't register. Is it a problem? Will I still be able to participate?

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

    Response from Code Jam team:

    If you have an existing user profile in our system (say for a previous year's round of DCJ, participating in a spinoff competition like Kickstart or I/O) then our system registered you automatically. The best way to check this will be to login with the email where you receive our Code Jam email notifications, as this would be the account that we automatically registered.

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

Google Geometry Jam 2018

Btw, how to solve C?

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

    Even the first one is sort of geometry:))

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

      I don't really understand the editorial for the third one. There are several blurred parts but what interests me the most is how to get the polynomial algorithm. There is an explanation for being at most 2 good choices for a third point of a valid plane when you have two points fixed already. And I agree with that (it depends in which direction you rotate). And it seems like the solution somehow concludes one of them is better without actually telling why is that. Can someone, please, explain?

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

        If I'm not mistaken you can chose whichever of these 2 points. No matter what you chose you can continue this process until nothing is left.

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

          I'm still trying to understand the rest, but could you tell me why you think that is like that? I can't see any way to prove it

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

            I keep an invariant that I have two points so that there exists third point such that all the rest lies below plane determined by these three. Note that this invariant is equivalent to "there exists a plane passing through P and Q only so that all the rest is below that plane", because I can rotate it around PQ and I will encounter some point which can be the third one from previous formulation. So let these points be P and Q (where P is further in order, so that it will be removed earlier) and let third point be R. I remove P, do assigment P:=Q, Q:=R and I know that there exists a plane passing through new P and Q which has all the rest below (which is second version of my invariant), so invariant is kept and everyone is happy.

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

              Thanks a lot! It makes sense, I've thought of looking for an invariant but I was too stupid to see it was in front of my eyes. So the initial choice should just be of 3 points that are above all the others, and we can do that by fixing all the points of max z (at most 3 of them) and then one other point and then rotating the plane around this line so it's a N^2+N^2. Makes sense. Thanks again!

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

                We just need two points and you can take arbitrary edge of a convex hull when projected onto OXY plane.

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

            I didn't got AC so not sure if I can talk, but you can easily understand the solution if you think for a 2D variant : y = 0, and triangle to line segment.

            Then, you can remove any point in a convex hull, remove another point that was adjacent in previous convex hull, and so on..

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

            Ultimately, this is about a general property of convex hulls: Let X be a set of points, Y be a subset of X, and p be a vertex of the convex hull of X. Then, if p is contained in Y, p must be a vertex of the convex hull of Y.

            This time, we keep three vertices that forms a face of the convex hull. Even if you remove arbitrary one of these three, the remaining two points must form an edge of the convex hull of remaining points, because these two points are vertices of the convex hull of remaining points.

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

Finding out the bounding rectangle of 2D points -- 14 points. Finding out line and plane intersection in 3D -- 7 points.

ggwp.

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

    I don't know how to prove the first one, but I know how to prove the brute for the third one:))

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

      I agree with you. Solution make sense but I don't have a proof, 3rd one is harder to code but it's just code anyway.

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

      Nevermind, I misread the task as every student follows a teacher. Okay. I take my complaint back.

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

    Looking at standings not having red color on your flag is already gg

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

    We don't need anything complicated in C-easy. We only need to check if a point is under a plane defined by three points. This can be done with a matrix determinant.

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

Let me whine a little bit...

This year I got 51 points and 30th place. In last minutes I tried coding small C, but lacked something like 1 or 2 minutes and that would guarantee me place in finals. Half a minute before start of competition my computer got some fatal error and I needed to restart it what lasts ~3 minutes (however I read A's statement on phone, but it was distracting either way).

Last year when solving A I panicked and submitted solution that I was not sure about because I forgot that in GCJ time penalty is max not sum, so I could have solved that one later without any consequences. After solving all the rest (except large D) for half an hour only thing I could do was seeing how I am falling in standings finishing somewhere around ~30th place. In that half an hour I would be able to fix my A dozen of times (it lacked one line).

It seems that me and GCJ is not a very fortunate connection.

EDIT: Great, I have just commented out one stupid line in my solution to D and it passed large test xD ( ͡° ͜ʖ ͡°)

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

    I remember once the 34th person qualified, but last year even the 28th person didn't qualify, so you'll be nervous for a while.

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

    Is it "ignore self-loop" on construction of a dual graph? It was my stupid line.

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

      I guess that it you take any AC you can add to it a stupid line in many places :p. Mine was ignoring spanning tree's edges when deciding whether I can build some non-tree edge.

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

xd

I've started 20 minutes late because of terrible Internet connection in a train, and later I was rarely able submit. Maybe it's good not to look at the standings and to implement some problems first without submitting anything.

Two hard geometry problems, keep it up GCJ!

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

Can anyone challenge the following solution for D-small?

First, we rotate all points by a random angle, now we can assume that all points have different x-coordinates. For a segment connecting (x1, y1) and (x2, y2) (x1 < x2), assign the pair (x1, atan2(y2 - y1, x2 - x1)). Sort the segments using this pair.

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

    0 -5 5 0
    0 5 5 0
    0 -5 5 0
    4 0 5 0
    5 0 6 1

    Assume you rotate it by an extremely small angle. Then you will close a triangle (0,  - 5), (0, 5), (5, 0) before doing the two other segments (one of them is inside, one is outside the triangle).

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

      Thank you! I thought this way we can always find one of the outmost remaining segments, but it fails with your case.

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

        The editorial says: "Each way has its own pros and cons, but many of them also have the property that the reverse of the ordering they produce is also a valid ordering.". I realized that for my solution this property doesn't hold. We should always use the reverse order, and it passed in practice room (to handle K = 2, try various angles for the initial rotation).

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

The input limit of "Name-Preserving Network" problem is actually tight.

I wrote a program that uses Graph Isomorphism as labeling scheme after the contest. I found no solution for n in {5,6,7,8,9}. I tested all possible degree=4 graphs. The number is pretty small, only 1024380 (OEIS) for n=9.

n=10 was the smallest possible size.

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

    But for n=10 first random graph I generated worked

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

      Right, for n=10, the probability seems pretty good. When I tested n=10, more than 20% of the random graphs were positive.

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

    This fact was quite an issue for me during the contest. Indeed I was testing my program with N=6 and it could not create a random graph without symmetries (as such a graph does not exist). Then, changing N from 6 to 10 made it work smoothlessly and only now I do understand why.

    Btw, very nice task!