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)
wow i managed to understand text translated with Google Translate
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.
.
My code is not going to pass the main tests anyway if it has some flaws and doesn't get hacked,Right?
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.
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.
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).