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

此题递归就可以0MS

Posted by 200593141 at 2007-08-07 08:43:38 on Problem 2407
int PHI( int &Integer )
{
  int Uplimit = (int)sqrt(Integer) ;
  for( int item = 2; item <= Uplimit; item++ )
	  if( !nprim[item] && Integer % item == 0 )
		  if( Integer / item % item == 0 )
			  return item * PHI( Integer /= item ) ;
		  else
		      return (item-1) * PHI( Integer /= item ) ;
  return Integer - 1 ;
}

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