标签:
解题思路:
深入理解lucas定理.
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#define LL long long 
using namespace std;
int N;
int main()
{
	while(scanf("%d", &N)!=EOF)
	{
		int cnt = 0;
		while(N)
		{
			if(N & 1) cnt++;
			N >>= 1;
		}
		printf("%d\n", 1<<cnt);
	}
	return 0;
}
HDU 4349 Xiao Ming's Hope(数学题,Lucas定理)
标签:
原文地址:http://blog.csdn.net/moguxiaozhe/article/details/43876253