[高维前缀和] ZROI 2017提高2 World Of Our Own
来源:互联网 发布:macsd卡恢复软件 编辑:程序博客网 时间:2024/05/19 18:42
好题。设
现在我们需要考虑如何判断一个组合数的奇偶性。考虑
即
所以,每个
#include<cstdio>using namespace std;int n,a[8400001],b,c,d;long long ans;int main(void){ scanf("%d%d%d%d%d",&n,&a,&b,&c,&d); for(int i=1;i<=n-1;i++)a[i]=(1ll*a[i-1]*a[i-1]+1ll*b*a[i-1]+c)%d; for(int i=0;i<23;++i) for(int j=0;j<=n-1;++j) if(!(1<<i&j)) a[j|(1<<i)]^=a[j]; for(int i=0;i<=n-1;i++) ans^=1ll*(i+1)*a[i]; printf("%lld",ans); return 0;}
阅读全文
0 0
- [高维前缀和] ZROI 2017提高2 World Of Our Own
- World of our own(NOIP2017模拟题)
- [DP] ZROI 2017 提高3 T3 建筑
- 高维前缀和
- HDU5977 Garden of Eden 树分治+高维前缀和
- HDU5977 Garden of Eden 树分治+高维前缀和
- [DP] ZROI 2017提高1 T2.给 Ca
- [数位DP] ZROI 2017 提高3 T1 树状数组
- [DP] ZROI 2017 提高6 T2 异或统计
- [DP] ZROI 2017提高 5 T2. 石头剪刀布
- [表达式求值 矩阵乘法] ZROI 2017提高10A. Calc
- hdu 5977 Garden of Eden(树分治+高维前缀和)
- Most of the shadows of life are caused by standing in our own sunshine.
- Hdu 5765 Bonds(高维前缀和)
- hihocoder1496-高维前缀和|暴力
- [高维前缀和] Codeforces 449D
- Lessons from Google Wave and REST vs. SOAP: Fighting Complexity of our own Choosing
- [数学杂题 位运算] ZROI 2017 提高6 T1 异或统计
- PHP接口概述
- for循环内局部变量的生命周期
- cadence创建原理图文件库时遇到的package Type
- 桂林两夜三日游(程序员也是要放松放松的)
- 第二期 QEMU模拟vexpress-a9开发板 《虚拟机就是开发板》
- [高维前缀和] ZROI 2017提高2 World Of Our Own
- python 内置函数
- 数据库总结(二)
- C++枚举类型详解
- mysql 一主多从配置说明
- NOIP2017清北综合强化试题
- 社团划分结果评估指标:Q、ARI、NMI
- 算法笔记 //03_众数问题
- PTA一元多项式的乘法与加法运算