n=gets.to_ixs=gets.split(" ").map{|e| e.to_i}r=0rr=[0]*40#rr=[0]*1000001xs.each{|x| r=r^x rr[r]+=1}p rr
5 10 1 2 4 8 16
[0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!