SRM 330 Long Long Nim

330
games
nim
srm

#1

I understand that the periodicity of the array will be 2^22.But how are they calculating res using bitwise operators.Can anyone explain.Reference link is -
http://community.topcoder.com/stat?c=problem_solution&rm=262996&rd=10010&pm=6856&cr=10574855