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

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

Hello Codeforces! Did you miss Limak?

I’d like you to invite for CodeChef February Lunchtime that will start at 19:35 IST / 17:05 MSK of 25-th February 2017 (check your time zone here) and will last 3 hours. The contest starts 5 minutes later than usually to allow you to catch a breath after the AtCoder Mujin Contest that ends at 17:00 MSK.

I am an author of problems and editorials, while niyaznigmatul is a tester. I want to thank PraveenDhinwa (who is a contest admin) and suraj_sharma for their technical help. Translators: CherryTree (Russian), huzecong (Mandarin) and VNOI team (Vietnamese). Language verification: arjunarul.

There is no registration required, anybody with a CodeChef handle can participate. Top school participants can win CodeChef laddus (details on the contest page).

You will be provided 4 problems with subtasks (IOI-style grading). Ties are broken by time of reaching your final score. The contest should be a bit easier than a Div1 Codeforces round. I honestly think that all problems are interesting and valuable — some for beginners and some for experiences competitors (IMO one particular problem is so new and beautiful). Remember about subtasks if you can't solve a problem for the full score, and read the editorial after the contest.

I wish you great fun and no frustrating bugs. Hope to see a lot of you in the leaderboard!

EDIT: The time of start corrected to "19:35 IST / 17:05 MSK".

EDIT2: Bump, the contest starts in 24 hours.

EDIT3: The contest is over. I hope you enjoyed problems. You can find editorials here.

And congratulations to Petr, uwi and savinov for getting the top 3 places!

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

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

"I honestly think that all problems are interesting and valuable — some for beginners and some for experiences competitors (IMO one particular problem is so new and beautiful)."

Most probably joining based on this sentence.

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

bump, 3 minutes

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

I have noticed that:

Those who achieve the score first will be placed higher in the ranklist in case of a tie.

So, in case someone got 400, his rank should not be changed anymore as those who got 400 after him should rank lower than him.

However, when the ranklist first show my score was 400, my rank was 10. And just now when i refreshed the ranklist, I found out that my rank dropped to 14. Isn't this behavior impossible to happen?

Did I misunderstand the rules of ranking or there is something wrong with the ranklist?

UPD Some of the contestants ranked higher than me achieved 400 later than me.

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

    Thanks for letting us know. Indeed something is broken with the leaderboard. We'll investigate that.

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

    I think Codechef IOI style leaderboards take into account penalties. So maybe you have better solving time but more penalties.

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

      But the rules stated that:

      You can submit solutions as many times as you'd like, there are no penalties for incorrect submissions. Only your best correct submission will be considered.

      So there should not be any penalties to wrong submissions.

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

    The problem is fixed. You can check your place now.

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

Can anybody give some edge cases/tricky test cases for Bear and Bribing Tree? I can't find the mistake in my logic.

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

    Your submission wrong on this case:

    2
    3 9
    6 10 3 15 1 13 16 19
    3 10
    1 8 9 15 10 4 13 20
    

    The correct answer should be:

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

From your codechef blog: "IMO one particular problem is so new and beautiful"

So which one was it?

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

    overflow-points problem — I've never seen something similar and the solution is just cute.

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

      I believe, it's very sad that this problem can be solved with a purely random algorithm.

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

        How?

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

          I also want to know how! I didn't see any AC solution that is a "purely randomized algorithm", though I agree that one part of the solution can be done with randomization.

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

            Here is my solution. I think it's purely random algorithm.

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

              Can you show me how to run the randomized part of your solution? It doesn't seem to finish in minutes on my machine, even for k = 2, what I guess tries to find 3 points.

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

                Actually, there's no magic, I just waited. I think 2-3 minutes for one new point.

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

                  You are right, it found the next point. Apparently I didn't try hard enough during the problem preparation.

                  Are you able to explain why it works? I have no idea why this program is able to find more than 3-4 points.

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

                  Of course I can't. During the contest I understood that I'm stupid enough to solve more than 2 problems and the only hope to get a better rank was to try this random algo... And I'm not very proud right now

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

                  But trying this algo turned out be a great idea. You solved a problem so there is nothing be ashamed of. The question is: why it works? I will try to figure that out.

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

            I believe the main difficulty was to find ten non-collinear points with small (<=15) coordinates (after that just multiply each coordinate with 216)? I just did this: add the points with both coordinates  ≤ 15 in a vector. At each step consider the current element in the vector and if it is not in the same line as any two chosen points choose it (otherwise ignore it). This gave me 19 points which was more than enough. Code

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

              This is intended. Still, what Djok216 described is completely different.

              Also, I don't agree with you about the main difficulty. Finding such non-collinear points is easy even without computer. I still think that the hardest part was to get the idea about coordinates divisible by 216.

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

          Just generating random points and checking if the new point is ok to be taken.

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

      but this particular problem is not IOI-style, is it? but it's interesting anyway

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

      Thought I couldn't solve this problem, I enjoyed solving the other three very much. Thanks for preparing such nice problemset.

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

Will there be an editorial?

Is there a way to see the tests on codechef?

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

    All editorials can be found here.

    You can't see tests. Likely stress testing your solution locally will help you to find a counter-test.