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

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

In Codeforces Round # 439 (Div. 2), my B title was hacked so that I late passed through for 1 hour and lost a lot of points. The first hack, or a bit uncomfortable. But also told me that their code ability is still relatively weak, error correction capability has yet to be improved.Although hacker Dragon made me rank behind, but from a certain point of view, I would like to thank him. Because he made me discover my own shortcomings. (original is Chinese,Translation is provided by Google Translate)

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

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

wow i managed to understand text translated with Google Translate

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

I got the B problem hacked too. If it serves as a comfort, the problem itself was hack-propense if you didn't see the "trick" explained in the editorial.

When I submitted B I was almost sure it was going to be hacked, so I did a brute force solution (precalc all the factorials, a partial sum and then the simulation of the division) and I found some cases that broke it. The brute solution takes time to code but it is better to have it than to pray that no one hacks you.

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

.

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

    My code is not going to pass the main tests anyway if it has some flaws and doesn't get hacked,Right?

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

      Not necessarily true. It depends on the strength of the test cases, and then there are the randomized solutions which require personally crafted counter-examples for each, so it is tough to eradicate them in generalised system testing.

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

        Can you give an example of a randomized-solution? I haven't seen any such solution yet. I'd like to know more about these.

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

          See 76028218 for example. The problem is really complicated, but it's randomized algorithm is very easy (the tough is to prove it's chances of failing).