ENG  RUSTimus 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 1941. Scary Martian Word

test 2
Posted by [TDUweAI] daminus 5 Jan 2013 15:08
what can be in test 2/////
Re: test 2
Posted by ASK 19 Feb 2014 00:13
I guess it is an anti-hash string <https://en.wikipedia.org/wiki/Thue%E2%80%93Morse_sequence>

My additive hash with N=10 uint64_t still works, while N=5 does not:

  F(i,N) r[i] += ((a<<40) ^ (b<<20) ^ c) * s[i] % q[i]

a,b,c are letters;
s[i] and q[i] are primes;
F(i,n) is for(int i = 0; i < (n); ++i)