| ||||||||||
| 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 | |||||||||
水过200~~~~付代码(写的很丑,轻喷)就是2^n<1*2*3...m
n<log21+log22+log23.....然后换底公式
#include<stdio.h>
#include<math.h>
int find(int n)
{
double t=pow((double)2,(n-1960)/10+2),sum=0;
int i=0;
for(i=2;sum<t;i++)
{
sum+=log((double)i)/log((double)2);
}
return i-2;
}
int main()
{
int n=0;
while(scanf("%d",&n)&&n)
{
printf("%d\n",find(n));
}
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator