mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
Create 1050.cpp
This commit is contained in:
parent
6e1190ec58
commit
66d145aba4
34
HDOJ/1050.cpp
Normal file
34
HDOJ/1050.cpp
Normal file
|
@ -0,0 +1,34 @@
|
|||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <algorithm>
|
||||
using namespace std;
|
||||
#define MAXINTERVAL 512
|
||||
int a[MAXINTERVAL];
|
||||
int main()
|
||||
{
|
||||
int t;
|
||||
scanf("%d",&t);
|
||||
while(t--)
|
||||
{
|
||||
memset(a,0,sizeof(a));
|
||||
int n;
|
||||
scanf("%d",&n);
|
||||
int max=0;
|
||||
for(int i=0;i<n;i++)
|
||||
{
|
||||
int s,t;
|
||||
scanf("%d %d",&s,&t);
|
||||
if(t<s) swap(t,s);
|
||||
t=(t+1)/2;
|
||||
s=(s+1)/2;
|
||||
for(int j=s;j<=t;j++)
|
||||
{
|
||||
++a[j];
|
||||
if(a[j]>max) max=a[j];
|
||||
}
|
||||
}
|
||||
printf("%d\n",max*10);
|
||||
}
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user