-
#include <stdio.h>
-
-
struct
-
{
-
ints;
-
int f;
-
}MovingEvent[201];
-
-
void swap(int *a, int *b)
-
{
-
int t;
-
t = *a;
-
*a = *b;
-
*b= t;
-
}
-
-
int main()
-
{
-
int m,n, i, j, count[401], time;
-
scanf("%d", &m);
-
while(m--)
-
{
-
scanf("%d", &n);
-
i = 1;
-
time = 0;
-
memset(count, 0, sizeof(count));
-
while(i <=n)
-
{
-
scanf("%d%d", &MovingEvent[i].s, &MovingEvent[i].f);
-
MovingEvent[i].s= MovingEvent[i].s%2==0 ? MovingEvent[i].s/2 : MovingEvent[i].s/2+1;
-
MovingEvent[i].f = MovingEvent[i].f%2==0 ? MovingEvent[i].f/2 : MovingEvent[i].f/2+1;
-
if(MovingEvent[i].s> MovingEvent[i].f)
-
{
-
swap(&MovingEvent[i].s, &MovingEvent[i].f);
-
}
-
i++;
-
}
-
for(i=1;i<=201;i++)
-
{
-
for(j=1;j<=n;j++)
-
{
-
if((MovingEvent[j].s<= i)&&(MovingEvent[j].f >= i))
-
{
-
count[i]++;
-
}
-
}
-
if(time < count[i])
-
{
-
time = count[i];
-
}
-
}
-
printf("%dn", time * 10);
-
}
-
return 0;
-
}
-
-
/*
-
下面这个是刚开始用贪心时测试时弄的输出,因为这组是错的,所以输出来看下运算过程。
-
结果还是不行,最后还是用了另外一种更简便的方法。
2011-03-13 14:46 发表于百度空间,今搬至CU。
阅读(971) | 评论(0) | 转发(0) |