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

明白了,k=1是RE

Posted by jackie_wyx at 2006-12-11 13:32:54 on Problem 3104
In Reply To:那我就实在不知道为什么RE了? Posted by:jackie_wyx at 2006-12-11 13:25:06
> #include <stdio.h>
> 
> main()
> {
>   __int64 a[100010];
>   __int64 i,n,k,t,sum,tb,te;
>   
>   while((scanf("%I64d",&n))!=EOF)
>   {
>     tb=1;
>     te=0;
>     for(i=1;i<=n;i++)
>     {
>       scanf("%I64d",&a[i]);
>       if(a[i]>te) te=a[i];
>     }
>     scanf("%I64d",&k);
>     while(tb!=te)
>     {
>       sum=0;
>       t=(tb+te)/2;
>       for(i=1;i<=n;i++)
>       {
>         if(a[i]>t) sum+=((a[i]-t-1)/(k-1))+1;
>       }
>       if(sum>t) tb=t+1;
>       else te=t;
>     }
>     printf("%I64d\n",te);
>   }
>   
>   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