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

定理

Posted by GreatAccepted at 2010-02-13 13:37:27 on Problem 3219
In Reply To:1句话AC Posted by:plokzfadai at 2010-02-08 23:19:23
c(n,k)(k<=n)的奇偶性取决于(n-k)与k的二进制表达式是否存在同一位上的两个数码均为1,若存在,则为偶数,反之为奇数

#include<stdio.h>
int n,k;
int main(){
    while(scanf("%d%d", &n, &k)!=EOF){
	printf("%d\n", k&(n-k)?0:1);
    }
    return 0;
}
参考资料:【数学通讯(2006年第一期)】“二项式系数奇偶性的判定准则”

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