hdu—1050
解法:
#include<iostream>
#include<cstring>
using namespace std;
int main(){
int t,k;
cin>>t;
for(k=1;k<=t;k++)
{
int n,i,j,count[403];
memset(count,0,sizeof(count));//初始化
cin>>n;
int a,b,temp;
for(j=1;j<=n;j++)
{
cin>>a>>b;
a=(a-1)/2;//走廊数
b=(b-1)/2;//走廊数
if(a>b)
{
temp=a;
a=b;
b=temp;
}
for(i=a;i<=b;i++)
count[i]++;
}
int max=count[1];//初始化
for(j=1;j<=200;j++)
if(max<count[j])
//选取其中最大的数乘十
max=count[j];
cout <<max*10<<endl;
}
return 0;
}