您的位置:首页 > 其它

Moving Tables

2016-03-22 21:33 274 查看

Moving Tables

Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 12304 Accepted Submission(s): 4226


[align=left]Problem Description[/align]
The famous ACM (Advanced Computer Maker) Company has rented a floor of a building whose shape is in the following figure.

#include<stdio.h>
#include<string.h>
int main()
{
int count[205];
int end,begin;
int T,n;
int temp,i;
int max;
scanf("%d",&T);
while(T--)
{
memset(count,0,sizeof(count));
scanf("%d",&n);
while(n--)
{
scanf("%d %d",&begin,&end);
if(begin>end) {temp=begin;begin=end;end=temp;}
for(i=(begin+1)/2;i<=(end+1)/2;i++)
{
count[i]++;
}
}
max=0;
for(i=1;i<=202;i++)
{
if(max<count[i]){max=count[i];}
}
printf("%d\n",10*max);
}
}


View Code
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: