NC24035. [USACO 2016 Jan P]Mowing the Field
描述
输入描述
The first line of input contains N (2≤N≤100,000) and T (1≤T≤N, T even).
The next N lines describe the position of the mower on days 1…N. The ith of these lines contains integers xi and yi (nonnegative integers each at most 1,000,000,000).
输出描述
Please output a count of the number of crossing points described above, where FJ re-cuts a point of grass that had grown back after being cut earlier.
示例1
输入:
7 4 0 10 10 10 10 5 3 5 3 12 6 12 6 3
输出:
1
说明:
Here, FJ crosses on day 7 a segment of grass he cut on day 2, which counts. The other intersections do not count.