您的位置:首页 > 其它

2661 Factstone Benchmark 解题报告

2009-03-15 11:22 267 查看
#include<math.h>
#include<stdio.h>
#define pi 3.14159265
#define e 2.71828183
int main()
{
int y,last(0);
double m;
for(int y = 1; y <= 22; y++){
m = pow(2.0,y)/log(2.0);
for(int n = 1; true; n++)
if(n*log(1.0*n/e)+log(sqrt(2*pi*n)) > m)
break;
else
last = n;
printf("%d,",last);
}
return 0;

}


#include<math.h>
#include<stdio.h>
#define pi 3.14159265
#define e 2.71828183
int main()
{
int y,last(0);
double m;
int arr[] = {3,5,8,12,20,34,57,98,170,300,536,966,1754,3210,5910,10944,20366,38064,71421,134480,254016};
while(scanf("%d",&y)&&y)
{
printf("%d/n",arr[(y-1940)/10-2]);
}
return 0;

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: