Continuing the gadfly/software tester/push the limits theme, I would like to propose a solution.
In addition to randomly flipping switches, each prisoner writes his name on the wall of the room when he visits it. Since the warden promised not to let anyone in the room except when the prisoners are there, the names won’t be erased or added to without the prisoners’ knowledge. When all the names are there, then they’ve all visited the room.
Illegal? Nope. The warden says nothing about doing anything else when visiting the room, as long as they flip one and only one switch.
Wrong? Of course. But what are a bunch of dumb lags to do?