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

注意到a=(x)(x+1)和b=(x+2)(x+3)都是偶数,a和b中一定有一个4的倍数,然后用int就完事了

Posted by Javran at 2010-07-30 11:56:29 on Problem 3086
scanf("%d",&x);
a=(x*(x+1))>>1;
b=((x+2)*(x+3))>>1;
if (a&1)
	b>>=1;
else
	a>>=1;
printf("%d %d %d\n",t,x,a*b);

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