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 810974380 at 2009-08-27 21:03:55 on Problem 1183

#include<iostream>
using namespace std;
unsigned int a,i;
int main()
{ cin>>a;
  for(i=a;i>=1;i--)
  if((a*a+1)%i==0)
  break;
  a=2*a+(a*a+1)/i+i;
  cout<<a;
  system("pause");
  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