1050
作者:互联网
Hdu 1050
#include <bits/stdc++.h>
using namespace std;
#define MXN 210
// r[]房号对应的走廊编号,c[]计数
int n, r[MXN<<1], c[MXN];
int main(){
int T, n, s, t;
scanf("%d", &T);
for(int i = 1; i <= 200; i++) // 房号与走廊编号的对应
r[i<<1] = i, r[(i<<1)-1] = i;
while(T--){
memset(c, 0, sizeof c);
scanf("%d", &n);
for(int i = 1; i <= n; i++){
scanf("%d %d", &s, &t);
s = r[s], t = r[t]; // 房号转换为走廊编号
int tmp;
if(s > t) tmp = t, t = s, s = tmp; // 编号大小调整
for(int i = s; i <= t; i++) c[i]++;
}
for(int i = 1; i <= 200; i++) c[0] = max(c[0], c[i]);
printf("%d\n", c[0]*10);
}
return 0;
}
标签:1050,Tables,int,MXN,编号,tmp 来源: https://blog.csdn.net/ifypvu/article/details/116107751