GRID GAME and xor trick

Revision en1, by wineColoredDays, 2015-12-03 09:09:01

I was unable to solve the problem GRID GAME ( GRID GAME ) during the recently conducted ICPC Preparatory Series by team Enigma . The reason being i couldn't write the correct code to check whether the xor of the series x, x+2, x+4, ..., x+2*m-2 is 0 or not . But, after the contest i saw several different approaches to the problem . Some of them involved just 5-10 lines of code whereas some involved 20-30 lines of code . I'm very interested in knowing your approach . Thanks in advance for sharing :)

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English wineColoredDays 2015-12-03 09:09:01 578 Initial revision (published)