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:TLE help;

Posted by beiyouyu at 2007-07-09 14:14:16 on Problem 3244
In Reply To:Re:TLE help; Posted by:hduOZ at 2007-07-09 13:34:48
res = 0;
        
        __int64 tmp1, tmp2, tmp3;
        res += U[0] - U[1];
        tmp1 = res;
        res += V[0] - V[1];
        tmp2 = V[0] - V[1];
        res += W[0] - W[1];
        tmp3 = W[0] - W[1];
        for(i = 2; i < N; i ++) {
            tmp1 = tmp1 + i*(U[i-1] - U[i]);
            res += tmp1;
            tmp2 = tmp2 + i*(V[i-1] - V[i]);
            res += tmp2;
            tmp3 = tmp3 + i*(W[i-1] - W[i]);
            res += tmp3;
        }

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