ACM ICPC World Finals 2009
This problem essentially consists of two parts: evaluating circuits and finding flawed gates. Evaluating circuits can be done in a straight-forward way, once the somewhat tedious input format has been parsed. To find the flawed gate in the case that the circuit is flawed, one can simply check each gate for each possible error. If more than one possible explanation for the flaw is found, the error can not be completely determined.