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

(RMQ)If you have pass your own date, but always WA, you should check fuction Log2().

Posted by 2008022118 at 2010-01-06 16:23:14 on Problem 3264 and last updated at 2010-01-06 16:42:21
int Log1(int x)
{
    int i;
    for (i=16; i>=0&&(1<<i)>=x; i--);
    i++; 
    if ((1<<i)>x)   i--;
    return i;
}
int Log2(int x)
{
    int y = (int)(log((double)x)/log(2.0));
    return y;
}

You can try the two fuctions. -_-

Segment Tree is good! 1Y!
RMQ, cewawawawaAC

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