Блог пользователя javacoder1

Автор javacoder1, история, 9 лет назад, По-английски

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)

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
9 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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