please tell me of my logic was correct or i just got lucky to get it correct

if xor to a list of nos. is zero only then the division is possible
in this case patrick can be given the one candy with lowest value while sean
keeps the rest

if      xor(n nos.)=0
then       (nth no.) xor (xor of n-1 nos.)=0

so patrick gets the nth candy and sean keeps the rest

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.

Reply via email to