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

水过200~~~~付代码(写的很丑,轻喷)

Posted by Belldandy at 2012-08-01 00:58:02 on Problem 2661
就是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:
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