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

WA德郁闷了,实在找不到什么好的数据了~~~~~~~~~

Posted by fgjlwj at 2006-01-23 10:30:49 on Problem 1730
#include"stdio.h"
#include"math.h"

int main()
{
	__int64 n;
	while(scanf("%I64d",&n)==1 && n)
	{
		if(n==1)
		{
			printf("1\n");
			continue;
		}
		__int64 m,i;
		int f=1;
		if(n<0)
		{
			f=0;
			n*=-1;
		}
		for(i=32;i>=1;i--)
		{
			m=(__int64)pow(n,1.0/i);
			if(n==(__int64)pow(m,i))
				break;
		}
		if(f==0)
		{
			while(i%2==0)
				i/=2;
			printf("%d\n",i);
		}
		else
			printf("%d\n",i);
	}
	return 0;
}

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