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

什么意思啊 1183

Posted by shengxingheng at 2006-03-23 11:09:16
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
 long long c,a,b,x,y,u;
  cin>>a;
  b=a*a+1;
  c=floor(sqrt(b));
  u=100000;
  u*=10000000;
  for (x=1;x<=c;x++)
  {
     y=b/x;
     if (b==x*y)
       if (u>x+y)
             u=x+y;
      
     }
  cout<<u+2*a<<endl;

}
有人能讲解一下上面这个程序的思路么!

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