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 |
s 是否能由 n 个连续的数相加。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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator