标签:des style class blog c code
Time Limit: 1000MS | Memory Limit: 10000K | |
Total Submissions: 25176 | Accepted: 8373 |
Description
Input
Output
Sample Input
3 4 10 20 30 40 50 60 70 80 2 1 3 2 200 3 10 100 20 80 30 50
Sample Output
10 20 30
Source
1 #include <iostream> 2 #include<cstring> 3 #include<cstdlib> 4 using namespace std; 5 6 int main() 7 { 8 int n; 9 while(cin>>n) 10 { 11 int a,b; 12 int num[401]={0}; 13 for(int i =0;i< n ;i++) 14 { 15 int m; 16 cin>>m; 17 for(int k=0;k<m;k++) 18 { 19 cin>>a>>b; 20 if(a>b) 21 swap(a,b); 22 if(a%2==0) 23 a--; 24 if(b%2==1) 25 b++; 26 for(int j=a;j<=b;j++) 27 num[j]++; 28 } 29 int maxnum=0; 30 for(int i=0;i<401;i++) 31 { 32 if(maxnum<num[i]) 33 maxnum = num[i]; 34 } 35 cout<<maxnum*10<<endl; 36 memset(num,0,sizeof(num)); 37 } 38 } 39 return 0; 40 }
标签:des style class blog c code
原文地址:http://www.cnblogs.com/jhldreams/p/3750608.html