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

这题真的就这么水!暴力还0ms

Posted by KatrineYang at 2016-07-26 11:32:46 on Problem 1183
#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:
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