P2913 [USACO08OCT] Wheel Rotation G
题目描述
Farmer John has an old-time thresher (wheat harvester) that requires belts to be installed on various gears to turn the parts. The engine drives pulley 1 in a clockwise direction which attaches via a belt to pulley 2. Pulley 2 attaches via a belt to pulley 3 and so on through a total of N (2
输入格式
\* Line 1: A single integer: N
\* Lines 2..N: Each line describes a belt with three integers: S\_i, D\_i, and C\_i
输出格式
\* Line 1: A single integer that is the rotation direction for pulley N (0=clockwise, 1=counterclockwise)
说明/提示
As in the example illustration.