zoj 2996 (1+x)^n
来源:互联网 发布:郑州大学软件学院算211 编辑:程序博客网 时间:2024/06/08 14:21
点击打开链接
Please calculate the coefficient modulo 2 of x^i in (1+x)^n.
Input
For each case, there are two integers n, i (0<=i<=n<=2^31-1)
Output
For each case, print the coefficient modulo 2 of x^i in (1+x)^n on a single line.
Sample Input
3 14 2
Sample Output
10
我自己想不出来,只能是没听过这个知识点,判断C(n,i)的奇偶性,如果它是奇数就满足(n&i)==i
#include<iostream> using namespace std; int main() { int n,i; while(cin>>n>>i) { if((n&i)==i) cout<<1<<endl; else cout<<0<<endl; } return 0; }
阅读全文
0 0
- ZOJ 2996 (1+x)^n
- ZOJ-2996 (1+x)^n
- zoj 2996 (1+x)^n
- ZOJ 2996 (1+x)^n【模板题】【常用技巧】
- zoj 1489 2^x mod n = 1
- zoj 1489 2^x mod n = 1
- ZOJ 1489 2^x mod n = 1 数论
- zoj 1489 2^x mod n = 1
- ZOJ - 1489 2^x mod n = 1
- ZOJ 1489 HDU1395 2^x mod n = 1 数学
- zoj ——1489——2^x mod n = 1
- x^n+1~~~
- ZOJ 3175 Number of Containers(n/1+n/2+...+n/(n-1)+n/n求法)
- (((x)+(n)-1)&~((n) - 1) ) 详解!
- x^1 + x ^2 +...+x ^n = m 求x
- 1^x + 2 ^ x + 3 ^x + …… + n^x
- zoj 3175 Number of Containers (nbut1375) 计算n /1+n/2+n/3+n/4....+n/n
- (((x)+(n)-1)&~((n) - 1) ) 的数学原理
- HTTP代理服务器的工作原理
- PHP数组
- HashMap,ArrayMap,SparseArray源码分析及性能对比
- 小程序api开发官方开发文档
- ZooKeeper Distributed模式部署
- zoj 2996 (1+x)^n
- ROS(Robot Operating System)开发经验分享-开发工具
- activeMQ 在ssm中的使用-版本 5.14.4
- java反射破坏单例模式
- 剑指offer--二维数组中的查找
- 微信公众号自动化遇到的问题
- EasyUI datagrid获取数据问题
- 心理与自我生活 2
- body 标签禁止横纵滚动条