当前位置: 首页 > news >正文

云南省做网站开发的公司排名微网站建设方案

云南省做网站开发的公司排名,微网站建设方案,辽宁建设工程信息网新网站,静态网页制作方法位运算#蓝桥杯 文章目录 位运算#蓝桥杯1、小蓝学位运算2、异或森林3、位移4、笨笨的机器人5、博弈论 1、小蓝学位运算 #includebits/stdc.h using namespace std; using LL long long; const LL N 1e97; templateint kcz struct ModInt { #define T (*this)…位运算#蓝桥杯 文章目录 位运算#蓝桥杯1、小蓝学位运算2、异或森林3、位移4、笨笨的机器人5、博弈论 1、小蓝学位运算 #includebits/stdc.h using namespace std; using LL long long; const LL N 1e97; templateint kcz struct ModInt { #define T (*this)int x;ModInt() : x(0) {}ModInt(int y) : x(y 0 ? y : y kcz) {}ModInt(LL y) : x(y 0 ? y % kcz : (kcz - (-y) % kcz) % kcz) {}inline int inc(const int v) {return v kcz ? v - kcz : v;}inline int dec(const int v) {return v 0 ? v kcz : v;}inline ModInt operator(const ModInt p) {x inc(x p.x);return T;}inline ModInt operator-(const ModInt p) {x dec(x - p.x);return T;}inline ModInt operator*(const ModInt p) {x (int) ((LL) x * p.x % kcz);return T;}inline ModInt inverse() const {int a x, b kcz, u 1, v 0, t;while (b 0)t a / b, std::swap(a - t * b, b), std::swap(u - t * v, v);return u;}inline ModInt operator/(const ModInt p) {T * p.inverse();return T;}inline ModInt operator-() const {return -x;}inline friend ModInt operator(const ModInt lhs, const ModInt rhs) {return ModInt(lhs) rhs;}inline friend ModInt operator-(const ModInt lhs, const ModInt rhs) {return ModInt(lhs) - rhs;}inline friend ModInt operator*(const ModInt lhs, const ModInt rhs) {return ModInt(lhs) * rhs;}inline friend ModInt operator/(const ModInt lhs, const ModInt rhs) {return ModInt(lhs) / rhs;}inline bool operator(const ModInt p) const {return x p.x;}inline bool operator!(const ModInt p) const {return x ! p.x;}inline ModInt qpow(LL n) const {ModInt ret(1), mul(x);while (n 0) {if (n 1)ret * mul;mul * mul, n 1;}return ret;}inline friend std::ostream operator(std::ostream os, const ModInt p) {return os p.x;}inline friend std::istream operator(std::istream is, ModInt a) {LL t;is t, a ModIntkcz(t);return is;}static int get_mod() {return kcz;}inline bool operator(const ModInt A) const {return x A.x;}inline bool operator(const ModInt A) const {return x A.x;} #undef T }; using ZModIntN; int main(){ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);int n;cinn;if(n8192){cout0\n;return 0;}vectorint a(n),sum_xor(n1,0);for(auto x:a)cinx;/*为什么使用前缀异或和 快速计算任意区间的异或结果有了前缀异或和如果要计算区间 [l, r] 的异或结果只需要通过 sum_xor[r1] ^ sum_xor[l] 即可得到结果因为在l之前的数据包都是一样的异或结果都是0 */Z ans 1;for(int i1;in;i)sum_xor[i]sum_xor[i-1]^a[i-1];for(int i1;in;i){for(int ji;jn;j){ans*sum_xor[i-1]^sum_xor[j];}} coutans;return 0; }2、异或森林 #includebits/stdc.h using namespace std; int main(){ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);int n;cinn;vectorint a(n),sum_xor(n1,0);for(auto x:a)cinx;for(int i1;in;i)sum_xor[i]sum_xor[i-1]^a[i-1];/*是需要咱们找到连续子数组的数量n * (n 1) / 2 表示长度为1的子数组有 n 个长度为2的子数组有 n-1 个以此类推最终得到总共 n * (n 1) / 2 个子数组所以n(n1)/2 连续子数组个数 */int ans n * (n 1) / 2;// 记录每个前缀异或和的次数 vectorint cnt(4 * n 1);cnt[0] 1;/*n x|n n/x|n if xn/x那么说明这个n的因数就是奇数个了因为这两个数一样所以·判断条件就是 x^2n因为 奇数 个好判断所以我们列举出来所有可能的数量就是ans让 ans 减去奇数个的就行了 */ for (int r 1; r n; r) {for (int i 0; i * i 2 * n; i) {ans - cnt[sum_xor[r] ^ (i * i)];}cnt[sum_xor[r]];}cout ans \n;return 0; }3、位移 #includebits/stdc.h using namespace std; int main(){ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);int n;cinn;while(n--){unsigned int a,b;cinab;while(!(a1))a1;while(!(b1))b1;if(ab){coutNo\n;return 0;} // 因为输入的是10进制所以我们要转化这两个数的二进制状态vectorint A,B;while(a0){A.push_back(a1);a1;}while(b0){B.push_back(b1);b1;} //判断 b 是否在 a 里面int n (int) A.size(), m (int) B.size();// 字符串匹配 for (int i 0; i m - 1 n; i) {int fl 0;for (int j 0; j m; j) {// 对于 A 来讲 肯定是 每次移动B 从头开始的 if (A[i j] ! B[j]) {fl 1;break;}}}if (!fl) {cout Yes\n;return 0;}cout No\n;} return 0; }4、笨笨的机器人 #includebits/stdc.h using namespace std; int main(){ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);int n;cinn;vectorint a(n);for(auto x:a)cinx; int cnt 0;// 枚举集合此时 S 的每一位表示第 i 个数是加还是减// 为了生成长度为 n 的二进制数的所有可能情况// 通过这种方法来穷举所有的子集合for (int S 0; S 1 n; S) {int p 0;// 求第 i 位是加还是减for (int i 0; i n; i) {// S i 1 的意思是先做 S i再 1含义是 S 的第 i 位是不是 1// S i 等价于 S / 2 ^ i 下取整意味着去除了最后的 i 位此时个位数 (二进制) 是原数第 i 位// x 1 等价于与 1 取 and也就是只有 x 的个位与 1 做了 and即 x 的个位数是不是 1if (S i 1)p a[i];else p - a[i];}if (p % 7 0)cnt;}double ans (double)cnt/(1n);ans round(ans * 1e4) / 1e4;coutfixedsetprecision(4)ans;return 0; }5、博弈论
http://www.hkea.cn/news/14421874/

相关文章:

  • 怎么快速建立一个网站扬中网站推广报价
  • 电子商务网站设计物流方案业务外包
  • 做网站怎么不被找到怎样自己做网站卖钱
  • 学seo建网站南通市住房和建设局网站
  • 做色流网站要注意什么22 wordpress 模板
  • 深圳分销网站设计费用长久新开传奇网站
  • 做英语四级题的网站怎么做赌钱网站代理
  • 做排名出租网站免费客户管理软件排行
  • 网站建设的经费哈尔滨网站建设自助建站
  • 银川网站制作报价自定义短网址
  • 商品网站源码个人品牌网站设计
  • 福田做商城网站建设哪家公司便宜点杭州有哪些大数据知名企业
  • 昆明二建建设集团网站网站建设公司软件开
  • 如何做seo整站优化长治县网站建设
  • 网站建设费会计科目wordpress 老伍
  • 上线了相同网站百度排行榜风云榜小说
  • 泉州做网站设计公司关键词搜索引擎
  • 做网站需要技术在线制作带字图片
  • 官方企业微信app下载海南seo关键词
  • 公司展厅设计策划百度关键词优化培训
  • 石家庄做网站公司有哪些网站开发公司创业策划
  • 信誉好的赣州网站建设网站的建设价格
  • 做网站如何抓住客户的需求app开发公司需要多少人
  • 深圳市移动端网站建设网站改域名备案吗
  • 怎么做购物微信网站恩施网站建设教程
  • 服务器两个域名一个ip做两个网站个人主页展示店铺
  • 北京市建筑网站培训网站建设平台
  • 什么网站有高端定制案例建设厅焊工证查询网站
  • 制作图片的免费网站海南专业网站开发公司
  • 安徽平台网站建设设计wordpress 标签 超链接