Chasty's blog

By Chasty, history, 9 years ago, In English

I've never hacked a solution before. Could someone leave a link to learn how to hack? About the title In general. I mean how to generate counter-examples? what is the best way?

  • Vote: I like it
  • -17
  • Vote: I do not like it

»
9 years ago, # |
  Vote: I like it +41 Vote: I do not like it

»
9 years ago, # |
  Vote: I like it +2 Vote: I do not like it

Belive me,how to hack and all about hack,it's not improtant,it's better to learn some good algorithm and do 5-10 hard problem and your status "newbee" will be broken!!!

»
9 years ago, # |
  Vote: I like it +6 Vote: I do not like it

Think of any conceptual bugs you had while solving the problem and eventually worked out, and look for solutions with those bugs. Besides that, if you see a solution that's different from yours, try to prove its correctness, not necessarily formally, and if it's wrong there's a good chance a breaking case will emerge from this process.

»
9 years ago, # |
Rev. 3   Vote: I like it 0 Vote: I do not like it

Just to add to mkirsche's awesome answer,
One thing I notice for some people in Div.2 is that, they sometimes use STLs without considering the implicit complexities. For instance, strlen, string::find(), std::reverse .. etc. these do not work under O(1).

When you spot overly extensive use of STLs, there's a chance that they might fail under large test cases.

»
9 years ago, # |
  Vote: I like it +15 Vote: I do not like it

I think that you should learn how to solve problems right now, not how to hack solutions.