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

- -水过 附代码

Posted by Ink213 at 2013-03-02 22:53:52 on Problem 1183
#include<cstdio>
#include<cmath>
using namespace std;
int main()
{
    __int64 a;
    __int64 x;
    __int64 i;
    scanf("%lld",&a);
    x=a+(int)sqrt((double)a*a+1);
    __int64 min=(a+1)*(a+1)+1;
    for(i=x; i>a+1; i--)
    {
        if((i*i+1)%(i-a)==0)
        {
            if((i*i+1)/(i-a)<min)
                min=(i*i+1)/(i-a);
            break;
        }
    }
    printf("%lld\n",min);
    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