BATMAN Vs SUPERMAN

IN this question http://www.codechef.com/XCEP2014/problems/XC104
please explain what is the significance of line -Both of them can select any single heap of rocks at a time and then pick up any number of rocks from that heap but alternatively.
Also explain the the logic that i can implement.

Terima kasih dan salam kenal.
codechef Link

code Link