poj3219

c(n,k)(k<=n)的奇偶性取决于(n-k)与k的二进制表达式是否存在同一位上的两个数码均为1,若存在,则为偶数,反之为奇数

View Code
#include <cstdio>
#include
<iostream>
#include
<cstdlib>
#include
<cstring>
#include
<cmath>
using namespace std;

int main()
{
//freopen("D:\\t.txt", "r", stdin);
int n, k;
while (scanf("%d%d", &n, &k) != EOF)
printf(
"%d\n", k&(n-k)?0:1);
return 0;
}
原文地址:https://www.cnblogs.com/rainydays/p/1959685.html