| ||||||||||
| 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 | |||||||||
这题真的就这么水!暴力还0ms#include <iostream>
#include <stdio.h>
using namespace std;
int main() {
long long int A;
scanf("%I64d", &A);
long long int A2plus1 = A*A+1;
for(long long int B = A; B > 0; B--){
if(A2plus1%B == 0){
printf("%I64d\n", 2*A+B+A2plus1/B);
break;
}
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator