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:发一个ws代码

Posted by JiaJunpeng at 2014-05-09 19:37:48 on Problem 2411 and last updated at 2014-05-09 19:44:43
In Reply To:发一个ws代码 Posted by:angela_channg at 2011-03-23 21:52:59
> #define P 3.1415926535898
> #define F(x) x*x
> main(){int i,j,n,m;double s,t;while (scanf("%d%d",&n,&m),n){if (n*m%2){puts("0");continue;}t=pow(2,n*m/2);s=1;n++;m++;for (i=1;i<n;i++)for (j=1;j<m;j++)s*=F(cos(i*P/n))+F(cos(j*P/m));s=pow(s,.25);printf("%.0lf\n",s*t);}}

ORZ,您 的 算法 貌似 是O(n*m)的 ,相当 NB,能解释一下 么 ?谢谢 

好高端的 代码, 一定是用了什么 定理。。。。

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