VOI27's blog

By VOI27, history, 64 minutes ago, In English

As far as I know, hashing is a powerful tool to compare two strings in O(1) but it has an error rate; especially in online contests, where I saw so many submissions were hacked because of it. Therefore, I have some questions:

  1. Should I use hashing in online contests, or it is only good for offline competitions? And if yes, how should I use it to both meet the time limit and make it difficult to hack?
  2. Are there any alternatives to hashing which can't be hacked that run in O(1) or O(log(n))?

I appreciate your time reading and answering my questions.

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
54 minutes ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

It's definitely viable in online competitions, and is difficult to hack if you use a randomized base and a large enough modulo/multiple moduli, see https://usaco.guide/gold/hashing