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:我O(N^2)的算法 200+MS过了,代码仅7行。。。。

Posted by tzkq at 2010-06-11 20:19:34 on Problem 2182
In Reply To:我O(N^2)的算法 100+MS过了,代码仅17行。。。。 Posted by:wiseking at 2009-10-27 21:39:50
int i,j,n,s[9999],a[9999],b[9999];
main(){
for(scanf("%d",&n);++i<n;)scanf("%d",s+i);
for(i=n;0<i--;b[j]=a[i]=j)
for(j=0;0<=s[i];s[i]--)for(j++;b[j];j++);
for(i=0;i<n;i++)printf("%d\n",a[i]);
}

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