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

s 是否能由 n 个连续的数相加。

Posted by 913106840245 at 2014-10-31 10:28:06 on Problem 2140
bool f(int s,int n){
	if(n%2==1){
		return s%(n)==0?1:0;
	}else{
		return ((s%(n/2)==0) && (s/(n/2))%2==1)?1: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