javacoder1's blog

By javacoder1, history, 8 years ago, In English

I was trying to solve a question through hashing.When I used ll P1=1000000009,M1=1000001011 where i converted the string into P1 based number system and took modulo by M1 i got wrong answer on test 14 but the same code replaced with ll P1=257,M1=1000000007 passes the system tests. I know that the wrong answer would be because of collision So my question is how to know of what values to hash from before solving a question.Are there any set of values which give better performance in certain type type of questions? (ll means long long)

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

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

Auto comment: topic has been updated by javacoder1 (previous revision, new revision, compare).