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 |
猪头算法....In Reply To:这种猪头算法也能AC,这题太水了 Posted by:georgezhang at 2007-10-29 14:00:05 > > long int root(long int x,int n) > { > long int d=x; > long int r=1; > for(long int i=2;power(i,n)<=x+d;i++) > if(abs(power(i,n)-x)<d) > { > r=i; > d=abs(power(i,n)-x); > } > return r; > } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator