| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
我晕~ 输入数据要定义为无符号整型~ 否则 WA~
#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator