Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:明明一道水题,怎么那么多人过不了??还有我把它当水题做了,被吓到了。。。代码只有这么长

Posted by cigaring at 2010-11-10 13:58:57 on Problem 1083
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator