ENG
RUS
Timus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board
Discussion of Problem
1350
. Canteen
some_programming_novice
A bloom filter with this hash function can pass these test cases, please add more strict cases.
// Problem
1350. Canteen
22 Apr 2019 21:27
char buf[41];
unsigned hash()
{
unsigned h = 0;
for (char* p = buf; *p; ++p)
{
h = h * 13 + *p;
}
return h & 511;
}
Edited by author 22.04.2019 21:30
© 2000–2026
Timus Online Judge Team
. All rights reserved.