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 |
C代码,超简单,为什么还wa。。。#include <stdio.h> #include<string.h> int main() { int T,i,j,q,maxl,N; int arr[400][2]; int arr2[400][2]; while(scanf("%d",&N)!=EOF) { while(N--) { scanf("%d",&T); memset(arr2,0,sizeof(arr2)); for(i=0;i<T;i++) for(j=0;j<2;j++) scanf("%d",&arr[i][j]); for(i=0;i<T;i++) for(j=0;j<2;j++) for(q=0;q<T;q++) if(arr[i][j]>arr[q][0]&&arr[i][j]<arr[q][1]) arr2[i][j]++; for(maxl=0,i=0;i<T;i++) for(j=0;j<2;j++) if(maxl<arr2[i][j])maxl=arr2[i][j]; printf("%d\n",(maxl+1)*10); } } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator