标签:
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 24316 Accepted Submission(s):
8053


#include<stdio.h>
#include<string.h>
#include<algorithm>
#define MAX 1100
using namespace std;
int dp[MAX];
bool cmp(int a,int b)
{
return a>b;
}
int main()
{
int n,t,m,i,j;
scanf("%d",&t);
int a,b,c;
while(t--)
{
scanf("%d",&n);
memset(dp,0,sizeof(dp));
for(i=0;i<n;i++)
{
scanf("%d%d",&a,&b);
if(a>b)
{
c=a;
a=b;
b=c;
}
a=(a+1)/2;
b=(b+1)/2;
for(j=a;j<=b;j++)
{
dp[j]++;
}
}
sort(dp,dp+200,cmp);
printf("%d\n",dp[0]*10);
}
return 0;
}
hdoj 1050 Moving Tables【贪心区间覆盖】
标签:
原文地址:http://www.cnblogs.com/tonghao/p/4693428.html