Could anybody please explain to me this part of the solution of the Milk Measurement USACO Bronze Question?
I am not understanding these 2 parts of the solution:
bool is_highest(int c, int d)
{
int highest = max(max(rates[0][d], rates[1][d]), rates[2][d]);
return rates[c][d] == highest;
}
and
for (int d=1; d<=100; d++) {
if (is_highest(0,d-1) != is_highest(0,d) || is_highest(1,d-1) != is_highest(1,d) || is_highest(2,d-1) != is_highest(2,d))
num_changes++;
}