| ||||||||||
| 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:N肯定有大于80000的 我把int改成unsigned int 就从wa 变成ac 大家注意了 Posted by:Bzin at 2008-11-19 18:29:05 > int的最大值肯定够用 80000*80000=1.6*10^9
> 我用二分做的
>
> unsigned int Do(int left,int right)
> {
> int max;
> int i,j;
> int center;
> unsigned int retur;
> if(left==right)
> return 0;
> center=(left+right)/2;
> retur = Do(left,center)+Do(center+1,right);
>
> j=center+1;
> max=0;
> for(i=center;i>=left;i--)
> {
> if(Hight[i]>max)
> {
> max=Hight[i];
> for(;j<=right;j++)
> {
> if(Hight[j]>=max)
> break;
> }
> retur += j-center-1;
> }
> }
> return retur;
> }
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator