Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
AC (/≧▽≦)/#include<iostream> #include<stdio.h> #include<stdlib.h> #include<algorithm> #include<string.h> #include<map> #include<math.h> #include<vector> #include<queue> #include<stack> #define inf 99999999 using namespace std; int t,m,a,b,occ[210]; int f[210]; int main() { cin>>t; while(t--) { cin>>m; memset(f,0,sizeof(f)); memset(occ,0,sizeof(occ)); for(int i=1;i<=m;i++) { cin>>a>>b; int maxs=0; if(a>b)swap(a,b); for(int j=(a+1)/2;j<=(b+1)/2;j++) { occ[j]++; maxs=max(maxs,occ[j]); } f[i]=max(f[i-1],maxs*10); } cout<<f[m]<<endl; } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator