#PU763. USACO 2017 December Contest, Silver — Problem 2. Milk Measurement
USACO 2017 December Contest, Silver — Problem 2. Milk Measurement
USACO 2017 December Contest, Silver — Problem 2. Milk Measurement
题目描述
Each of Farmer John's cows initially produces gallons of milk per day (). Since the milk output of a cow is known to potentially change over time, Farmer John decides to take periodic measurements of milk
输入格式
The first line of input contains the number of measurements that Farmer John makes (), followed by . Each of the next lines contains one measurement, in the format above, specifying a day (an integer in the range ), the integer ID of a cow (in the range ), and the change in her milk output since it was last measured (a nonzero integer). Each cow's milk output will always be in the range .
输出格式
Please output the number of days on which Farmer John needs to adjust his motivational display.
数据范围
(见题面原文)
样例
样例 1
4 10
7 3 +3
4 2 -1
9 3 -1
1 1 +2
3
Problem credits: Brian Dean
提示
are noted in his log book as changing their milk production, there are always plenty of other cows around whose milk output level remains at gallons.