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

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

Hello, guys!

Recently ACM teams from the Baltic countries (Estonia, Latvia and Lithuania) have competed against each other in the programming camp which was held in Lithuania and was organized for the first time.

You are invited to participate in four competitions out of five in the Gym, which will be run for the four consecutive days starting from tomorrow.

Some problems in the camp were original, others were taken from old KTU contests (which are not in the Gym currently) or various local competitions that were not well-known for the participants of the camp. The competition of the day 4 was a mashup contest and consisted of Codeforces problems. As a consequence of this, it is skipped.

Have a good day and interesting contests :)

KrK

UPD: The slides of analyses which explain the solutions very briefly (some problems are not explained) can be downloaded here.

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

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

Nice:) Some link to the results of the competition mentioned above would also be interesting (if available).

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

Will there be editorials for the contests ? If not editorials then please give hints to solve the various problems.

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

Why did E from the last contest have so few solutions? It was really easy for geometry, just finding all points where the polyline crosses the polygon by brute force, sorting them in the order in which they appear on the polyline and summing up distances along the polyline between the (1st and 2nd), (3rd and 4th) etc (times 2 plus polygon circumference).

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

C."Reordering ones" from Day 5 isn't clear for me. Could someone explain its solution a bit more?

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

I'm fairly certain that some test cases for problem E of Day 5 are wrong (e.g., test 14)! Accepted solutions fail the following simple test case:

7 2
0 0
0 4
2 4
1 3
2 2
1 1
2 0
1 -1
1 6

The correct answer should be 21.656854.

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

    Anyone wants to point out where I'm wrong instead of just downvoting to oblivion?

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

    Hah, it seems your test is correct & all the Accepted solutions are wrong (checked with AC solution & 3 more AC solutions)

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

    I agree, my solution (described above) fails on this too, because it doesn't consider the possibility of an inner/outer touch. That should be the only thing that needs fixing.

    btw it's worth mentioning that your case looks like

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

      Hmm Xellos, I agree with you. As someone who has failed test 14, it seems like test 14 does have a polyline that intersects with the polygon with something like an inner-outer touch (I did check that case).

      EDIT: Indeed, after removing the inner/outer touch check from my original "incorrect" code, I got AC.

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

Realy nice problems! I haveemoutions from our problems. But where Day 4 now? :(

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

It seems problem J from contest 5 test cases are not so strong. I have ACed with the following solution (also the same idea as in KrK slide):

  • Get any edge AB from convex hull
  • Find C nearest to AB. (angle ACB is greatest).

This seems correct, but it will fail when convex hull forms a triangle ABC and there are a lot of points in segment AB. Inside the triangle, add a point P:

A--X1--X2--X3--X4--B
| P
|
C

In this example it can be seen that A-X1-P is a solution, but if you choose X4-B from the convex hull, the circle going through X4, B, P will contains some points of convex hull.

Does anyone know how to handle this case correctly?

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

    If a point D is contained inside the circle A,B,C and is on the same side of AB as C is (as it must be as AB is a edge of the convex hull) that means <ADB > <ACB, contradicting C being the point maximizing ACB, right?

    If in your case we choose X4-B and C is within the circle through X4, B, P, then we would instead choose the triangle BCX4.

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

      I see, I mistakenly thought that X3 will be contained in circle X4-B-P, but I can see now that angle is 0, and only C can be inside that circle. Thanks :)

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

I may be misunderstanding something, but I found problem A from day 1 very confusing. 100735A - Strong parentheses sequence

In the first paragraph, it states that

(A) is considered a correct parenthesis sequence.

But it doesn't say that A must be a correct parenthesis sequence, and it sounds like anything that starts with ( and ends with ) is correct, for example, "(()".

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

    "A sequence is called a strong parenthesis sequence only if it on form (A), where A is a correct parenthesis sequence."

    ^This is a sentence mentioned in the problem statement itself which makes it pretty clear and unambiguous.

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

      I was talking about the def of a correct parenthesis sequence.

      A sequence is called a correct parenthesis sequence if it's the following form:

      • Empty sequence is considered a correct parenthesis sequence.

      • (A) is considered a correct parenthesis sequence.

      • XY is considered a correct parenthesis sequence, if both X and Y are correct parenthesis sequences.

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

I found the problem G day 1 has a weak testcase. My submission got a bit typo and yet still AC

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

Can you host the editorial file somewhere else? Its asking me to sign up which requires credit card details. I don't have a credit card. :(

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

In Day one, what is test case 14 in problem E ?

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

slide download link is not working

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

slides link is dead