标签:des style c class blog code
题目:
1 #include<stdio.h> 2 #include<iostream> 3 #include<algorithm> 4 #include<string.h> 5 using namespace std; 6 7 typedef struct{ 8 int start; 9 int end; 10 }Table; 11 Table table[205]; 12 13 int getmax(int x, int y){ 14 return x > y ? x : y; 15 } 16 int getmin(int x, int y){ 17 return x > y ? y : x; 18 } 19 20 int main(){ 21 int t, n, i, j, visit[205], flag, num, max; 22 scanf("%d", &t); 23 while(t --){ 24 scanf("%d", &n); 25 memset(visit, 0, sizeof(visit)); 26 for(i = 0; i < n; i ++){ 27 scanf("%d %d", &table[i].start, &table[i].end); 28 table[i].start = (table[i].start + 1) / 2; 29 table[i].end = (table[i].end + 1) / 2; 30 for(j = getmin(table[i].start, table[i].end); j <= getmax(table[i].start, table[i].end); j ++){ 31 visit[j] ++; 32 } 33 } 34 sort(visit, visit + 205); 35 printf("%d\n", visit[204] * 10); 36 } 37 return 0; 38 }
标签:des style c class blog code
原文地址:http://www.cnblogs.com/xiaoyeye/p/3754840.html