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

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

Topcoder SRM 742 is scheduled to start at 11:00 UTC -5, Nov 28, 2018. Registration begins 24 hours before the match and closes 5 minutes before the match begins. Note: Registration for SRMs will now open 24 hours before the match.

Problem Writers: monsoon and misof

This is the first SRM of Stage 2 of TCO19 Algorithm.

Stage 1 TCO19 Points Leaderboard | Topcoder Java Applet | Next SRM 743 — December 8

Hope to see most of you competing! All the best!

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

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

Thank you for changing registration start time to 24 hours. I have missed few 6:30AM SRM because of this!

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

clash with educational round on codeforces.

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

"Note: Registration for SRMs will now open 24 hours before the match." — God bless you

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

Why in the hard problem the limit was changed from 500000 to 300000 during challenge phase? That seems extremely strange.

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

    I guess the limit never was 500000 in the checker (that is, the statement and checker had different limits when the contest started). That is worth mentioning even after coding phase, because people who prepared cases to get TLE would then get an unexpected error message from the checker and ask for a clarification.

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

      Yeah, it seems worth mentioning, but it still is extremely strange (or bad)

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

        Sorry, our bad.

        Nothing was changed.

        The constraint was supposed to be 300,000 and it was 300,000 everywhere: both in test data we had prepared and in the checker. Test data wasn't changed at all during the SRM.

        A very old version of the statement said 500,000 and somehow this constraint made its way into the version you saw in the arena. Might be some caching issue, I don't know at the moment. I'll try to investigate how it happened.

        The announcement was made late because only then we became aware of the discrepancy. It's better to make it late than to not make it at all.

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

I added ( #define int ll ) in my Div1-easy and it was not giving correct answer on samples.Once I removed it,it worked.

Did anyone experience it before,what is the reason ??

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

How is the checker in Div1 250 implemented? Here is my solution from the practice room:

  • Build 1/10 from 1 by building, in turn, 2, 1/2, 2/5, 1/5, 1/10.
  • Build 1/10^9 from 1/10 by repeating the above procedure several times.
  • Build 2^k / 10^9 for 0 < k < 60.
  • Build the required resistance bit by bit using serial connections. However, we do not have a zero, so use 1/10^9 as the starting value.

This construction achieves the resistance of exactly (required+1) nanoOhms, thus having the absolute precision of 10^(-9). However, it fails the system tests.

Note that the statement is formulated in terms of the real numbers and not the floating-point numbers and in this particular problem

  1. It matters.
  2. A precise checker can be implemented since all the possible numbers it has to deal with are rational.
  • »
    »
    6 лет назад, # ^ |
      Проголосовать: нравится +15 Проголосовать: не нравится

    It would be better to upload your code, as it might have a bug?

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

      The code is in the first revision of this post. The test is 9876. The error message is the following:

      Answer checking result:

      Resistance outside tolerance: expected 9.876E-6 received 9.877E-6

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

    A precise checker can be implemented since all the possible numbers it has to deal with are rational.

    Then the checker would either have to be able to handle intermediate bigints, or it would require some extra constraints in the statement. Seems like a bad idea.

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

      I disagree. The main job of a checker is to accept all correct answers and reject all incorrect ones, where "correct" is defined by the problem statement. If the statement does not restrict intermediate numbers, then this must be handled by the checker. Besides, both Python and Java have native big integers.

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

        A checker must be in Java in Topcoder system, so it isn't an issue at all :D

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

        You're missing the point. Is it easier to write a fraction-based checker than a float-based checker that does exactly what it should?

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

          I don't see how you could implement a float-based checker that "does exactly what it should", although I can write a "wrong checker". So yeah, I think it's far easier to write a former one.

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

            Prove that a float-based checker that "accepts all correct answers and rejects all incorrect ones" does not exist.

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

          I now see your point. Typically I'd agree with you, but this problem is special in my opinion. That is because the input is given in nano-ohms, and the output is meant to be correct up to 10^(-9) ohms, that is, 1 nano-ohm.

          While in (say) a geometry problem, getting a distance wrong by exactly 10^(-9) would be extremely implausible, in this case it merely represents subtracting 1 from the input. Since the corresponding answer is explicitly allowed by the statement (and it allows for a natural simplification in some correct solutions, as demonstrated by fetetriste), the checker has to accept error 10^(-9) and reject error 10^(-9) + eps for any eps > 0. Since 10^(-9) is not exactly representable by a floating point (base-2 mantissa) number, writing a floating-point checker under these constraints can be extremely tricky.

          I guess what I'm saying is that writing a checker that tests for error exactly at most 10^(-9) is always very hard (think interval arithmetic, and I'm not even sure it's feasible). Calculating the correct answer with doubles and checking if the distance to the contestant's answer is at most 10^(-9) gives a very good approximation to the checking problem, but an approximation is not good enough here.

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

            But the checker doesn't have to reject error 10^-9+eps. It just has to accept error up to and including 10^-9. In the statement, it doesn't say "your solution will be rejected if...". I'd even say that failing such solutions is an unnecessary dick move.

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

              Ah, okay. That makes sense! Good point.

              Edit: I still agree with you, but challenges can make this a bit confusing.

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

                Yeah, it seems the problem here is comparing <= 1e-9 instead of <= 1e-9 + eps. That should be fixable without having to deal with everything related to an exact checker (such as maximum running time of the checker). It's a useful possibility anyway.

                Challenges with floats... ew. They always carry some amount of risk. Imagine a problem where the answer is guaranteed not to significantly change when the input is rescaled/translated/something in main tests, now good luck guaranteeing it in challenges. Regular imprecision of floats poses a similar risk (a submission can fail because it neglects something that doesn't appear in main tests at all and it pushes the error for example to 3e-6 instead of < 1e-6). It's just worse in this case because the required precision is higher.

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

A quiz regarding d2 med: prove that a 50x50 board can't be covered by 16 queens.

Spoiler