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

I cheated on the judge.

Posted by hjin at 2007-07-23 06:44:55 on Problem 2231
Haha, guys. Guess what. I cheated on the online judge and she accepted the following 1/2*N*(N-1) algorithm !!!

181b with gcc
=================================================================
2373307 hjin 2231 Accepted 76K 873MS GCC 181B 2007-07-22 21:38:11 

程序代码:

main(){int N,i,j,c[10000];long long s;while(scanf("%d",&N)!=-1){s=0ll;for(i=0;i<N;++i){scanf("%d",c+i);for(j=0;j<i;++j)s+=c[i]>c[j]?c[i]-c[j]:c[j]-c[i];}s<<=1;printf("%I64d\n",s);}}

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