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 |
Re:明明一道水题,怎么那么多人过不了??还有我把它当水题做了,被吓到了。。。代码只有这么长In Reply To:明明一道水题,怎么那么多人过不了??还有我把它当水题做了,被吓到了。。。代码只有这么长 Posted by:jiyanmoyu at 2009-08-30 22:11:30 > #include<stdio.h> > #include<algorithm> > using namespace std; > #include<string.h> > const int length=200; > int counts[length]; > int main() > { > int T,i,j,k,N,s,t; > scanf("%d",&T); > for(i=0;i<T;++i) > { > memset(counts,0,sizeof(counts)); > scanf("%d",&N); > for(j=0;j<N;++j) > { > scanf("%d%d",&s,&t); > if(s>t) > swap(s,t); > s=(s-1)>>1; > t=(t-1)>>1; > for(k=s;k<=t;++k) > ++counts[k]; > } > printf("%d\n",*max_element(counts,counts+length)*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