Retired_xryjr233's blog

By Retired_xryjr233, history, 7 years ago, In English

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)

  • Vote: I like it
  • +13
  • Vote: I do not like it

»
7 years ago, # |
  Vote: I like it +20 Vote: I do not like it

wow i managed to understand text translated with Google Translate

»
7 years ago, # |
  Vote: I like it 0 Vote: I do not like it

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.

»
4 years ago, # |
Rev. 4   Vote: I like it -36 Vote: I do not like it

.

  • »
    »
    4 years ago, # ^ |
      Vote: I like it -9 Vote: I do not like it

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

    • »
      »
      »
      4 years ago, # ^ |
        Vote: I like it +3 Vote: I do not like it

      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.

      • »
        »
        »
        »
        4 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        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.

        • »
          »
          »
          »
          »
          4 years ago, # ^ |
          Rev. 2   Vote: I like it 0 Vote: I do not like it

          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).