主题:ACM题求教
There are several different concentric rings on the ground. Some of them may overlap. In Figure 1, there are 3 rings: blue, green and red. The red one is just above the green one. The problem is to remove minimum number of rings so that no two of the remaining overlap.
Figure 1
Input
The input consists of multiple test cases. Each test case starts with a positive integer N (<=10000) which represents the number of rings. The next N lines each line contains two positive integers which represents the inner radius and outer radius respectively.
Output
For each test case, output the minimum number of rings to remove.
Sample Input:
3
1 2
3 6
4 5
Sample Output:
1
要是看不懂的话 我翻译好了。不过我觉得应该不难理解
感觉上好象用贪心..不过我对贪心好象还不是很熟悉。..可不可以给个大致的思路呀
谢咯
Figure 1
Input
The input consists of multiple test cases. Each test case starts with a positive integer N (<=10000) which represents the number of rings. The next N lines each line contains two positive integers which represents the inner radius and outer radius respectively.
Output
For each test case, output the minimum number of rings to remove.
Sample Input:
3
1 2
3 6
4 5
Sample Output:
1
要是看不懂的话 我翻译好了。不过我觉得应该不难理解
感觉上好象用贪心..不过我对贪心好象还不是很熟悉。..可不可以给个大致的思路呀
谢咯