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

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

UPDATE: the editorial is here

Hello CodeForces! This year again, I'd like to invite you to the online mirror of an open championship of Switzerland called HC2 (the Helvetic Coding Contest). A mirror was also held last year and two years ago.

The Helvetic Coding Contest is a yearly contest held at the EPFL in Lausanne by the PolyProg association. The contest itself took place on March the 17th, but the online mirror is scheduled on Saturday, 14th of April, 10:05 Moscow time. The duration is 4:30.

Rules:

  • you can participate in teams or individually (1-3 people),

  • standard ACM-ICPC rules (no hacking),

  • the contest is not rated,

  • if you have participated in the onsite contest, please do not participate in the mirror.

The contest this year is Star Wars-themed. It features 6 series of 2-3 related tasks with increasing difficulty (easy/medium/hard). Sometimes it may be the case that a solution for the hard version solves all of them, but usually not. We think that the problemset is diverse and interesting, and while the contest is ACM-style, you will find that some problems are not so standard. Most easy&medium problems are even solvable in Python, so you can also recommend this contest to your newbie friends :) We promise to post a nice editorial as soon as the contest ends.

Acknowledgments: the problems were set by maksay, boba5551, mukel, DamianS, esrever, and myself. Thanks also go out to people who helped with the statements and testing: bgamlath, Michalina Pacholska (who also draws the cows), and KAN for CodeForces coordination, as well as everyone involved in the actual onsite contest, who are too many to name here. We also thank the sponsors Open Systems and AdNovum. Lastly, thanks to MikeMirzayanov for CodeForces and Polygon (which was used to prepare the problems).

Finally, in a bit of autopromotion, note that you can use Hightail to automatically test your solutions :) Good luck!

After-contest UPDATE:

>>> Editorial <<<

Feel free to ask questions in this topic.

Thanks to everyone who participated! We hope you have enjoyed the problems despite the interruption in judging. The top 4 teams, who have solved all problems, are:

  1. SpicyFriedTomatoes: AbstractKangaroo, EvenImage

  2. (`・ω・´): King_George, ohweonfire, FizzyDavid

  3. ymd队长ioi捧杯超稳: sunset, TLE, yanQval

  4. ★SweeT DiscoverY★: dotorya, molamola., zigui

See you again next year!

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

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

hoping for short prob statements unlike previous year

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

what happens when onsite participator sees the problem with the help of other user ID.

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

OH GOD, THIS PHOTO IS SO HOT

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

is it rated?

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

How to register as a team member...

I can't see it...

UPD: Fixed now, and wish everyone will enjoy the contest, GL & HF.

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

there is no team option in the register form .

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

Why...the "register as team member" button doesn't show up.. Is that a BUG?

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

Why am I not able to register as a team?

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

I have a question. Why I can register as a team member?

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

Is It Rated?

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

Is it semirated?

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

I'm looking for a team to participate in the contest. Please PM me in case you want to solve it together :)

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

Can we register from two different teams ?

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

Someone want to take me on their team, or form a team?

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

Servers are down :(

5 queue pages

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

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

Is scoreboard frozen??

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

contest extended by half an hour

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

We apologize for the technical problems with CodeForces. The queue is now moving again. The contest is extended by 30 minutes. It will remain unrated ;)

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

The editorial is up: editorial

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

We delayed the start of ARC/ABC by 10 minutes due to the extension of a contest in Codeforces. https://beta.atcoder.jp/post/220

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

I don't how to prove the correctness of the solution in the problem B2. Can you guys help me?

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

    I didn't prove it during the contest, but here's a stab at it. Let g1, g2, g3, ..., gK be the vertices the prescribed solution adds, in order. Suppose you have a solution S which is better than the prescribed solution. Let p be the smallest integer for which gp is not included in S. Let the "cover" of S be all planets controlled by the rebels in solution S. Since gp is a leaf, it is not part of the cover of S. Let A be the nearest node in the cover of S to gp. If we rebuild S on vertex at a time, starting with g1, ..., gp - 1, then there is some first vertex B which when added to S causes A to become covered. Because of how gp was chosen, it must be at least as deep in the tree as B. Thus, we can remove B from S replace it with gp, without decreasing the score: we will gain all the planets on the path from A to gp, and at worst lose all the planets on the path from A to B.

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

      Wow! Thank you very much. I really do learn something today!

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

      Wow, this is proof is so wrong that I don't even know where to start.

      If we rebuild S on vertex at a time, starting with g1, ..., gp - 1, then there is some first vertex B which when added to S causes A to become covered

      So you propose to remove $$$B$$$? If $$$B$$$ is among $$$g_1, g_2, g_3... g_{p-1}$$$, then does that not make your hypothesis invalid? And there is no reason why $$$B$$$ should be the $$$p^{th}$$$ element of $$$S$$$.

      And even if we overlook this glaring error, you just show that if $$$g_p$$$ is the first such element, the score does not decrease. But it changes the graph completely. So it may happen that, in the long term, the set $$$S$$$ overcomes our proposed optimal algorithm.

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

[del]

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

is there any O(Nk) solution of problem c2?

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

Great problemset today (especially B2, C3 and E2). Feel a bit sad for not figuring out B2 though...

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

I solved E3 with O(N2), not O(N2logN).

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

    Our solution during on-site participation when we had little time left was to pick a random point of each type and check whether they line through them has an equal number of points of each type to the left of it. Repeat this until we finde a suitable line, then solve the subproblems recusively.

    Is there an easy way of analysing the runtime?

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

    Just did the virtual contest today, so I'm 4 weeks late to the party. Nonetheless I just wanted to get this out since I thought it was an interesting approach to an interesting question.

    I claim that it's possible to find a dividing line that separates roughly into halves such that each half has equal spaceships and bases.

    I'm not exactly sure how to prove it formally, so I will talk through it for even N and hope that the proof is largely correct.

    Consider defining a half-plane by an angle theta from 0 to 2pi -- the dividing line is determined by the angle and theta and theta + pi are complementary half-planes. Moreover, we may shift the position of the dividing line so that N/2 points are on each side of the half plane.

    Let f(theta) denote the number of bases contained in the half plane minus N/2. For general theta (theta such that no 2 points are parallel to the line), f is well defined and f(theta) + f(theta + pi) = 0, since the half-planes are complementary.

    Note that f(theta) is "continuous" with respect to theta -- perturbing it slightly will include 1 more point and exclude 1 more point. Thus f will change no more than 1 at a time.

    Thus, by "Intermediate Value Theorem", we have a point in which f(theta) = 0, which is the dividing line we sought.

    To find this theta, we may binary search on theta by "Intermediate Value Theorem", starting from [0, pi] for example.

    If we believe that our binary search will terminate in X steps, then this gives each dividing step a time complexity of O(NX), for a total time complexity of O(NX lg N).

    (For this question X is not too large because the smallest gradient difference we can get is about 1/250^2. And by symmetry, a smallest possible angle between 2 lines lies between 0 and pi/4, so we can bound the smallest possible angle between 2 lines accordingly.)

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

      Actually, there always is a line that separates both the spaceships and the bases into half (Proof: Consider the dual space, then the median-level of the bases and the median-level of the spaceships intersect an odd number of times. The primal of the intersection point gives us the line we're looking for.) Such a line is called a Ham-Sandwich Cut. It can be found in linear time, but the algorithms for it have quite large constants AFAIK. This would lead to an solution, but nobody would want to code something like that.

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

I had a different solution to C2 and C3, running in .

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

(Edit: fixed the formula)

How did people deal with overflow in F3? When multiplying two polynomials, the coefficients can be up to about 10082 * 105, which means you need to use a prime bigger than 232 in the number theoretic transform, which in turn means you have intermediate values bigger than 264 — and annoyingly Codeforces still uses 32-bit C++ compilers so no __int128.

I tried to get around it by using the convolution with two different primes and then using the CRT to reconstruct the value, but it was too slow. That could just be my FFT implementation, which I've often had time out on other problems.

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

Is there a faster algorithm than O(K2) for E2?

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

Shame on the editorialist for problem B2. The proof is soooooooooooo hard. And all he writes is "exercise for the reader" and just describes the implementation. Yuck.