思维题
文章平均质量分 80
snbsczw
欲说还休,欲说还休,却道天凉好个秋
展开
-
LightOJ - 1058 Parallelogram Counting 平行四边形判定
There are n distinct points in the plane, given by their integer coordinates. Find the number of parallelograms whose vertices lie on these points. In other words, find the number of 4-element subsets原创 2017-12-25 11:50:31 · 252 阅读 · 0 评论 -
POJ 3252 Round Numbers (组合数,二进制)
题意 : 如果一个数化成二进制后零的个数比一的个数多(不算前导零),称这个数为Round Number, 问[a,b]内有多少个Round Number。(12×109" role="presentation" style="position: relative;">2×1092×1092\times10^9) 分析:原创 2018-01-31 17:32:54 · 216 阅读 · 0 评论 -
POJ 1845 筛法+分解质因数+快速幂+二分递归求等比数列和
题意: 给你两个数N,M;求NM" role="presentation" style="position: relative;">NMNMN^M的所有约数和对9901取模后的结果。(0 分析: 首先,要先明确一个定理。 整数唯一分解定理:任意大于等于2的正整数都有且只有一种方式写出其质因子的乘积表达式。 A =p1a1" role="present原创 2018-02-02 12:00:02 · 281 阅读 · 0 评论 -
求连续自然数区间的异或值
如题: 求[a,b]内所有数的异或值.为了方便用f([a,b])表示[a,b]内所有数的异或值. 首先,根据异或的规则可得 f([a,b])=f([1,b])^f([1,a-1]). 所以只要会求f([1,n])就可以了 1. 若a是偶数,则a^a+1=1; 这样就可以掐头去尾 中间的数两两配对 就算出来了 代码:ll GEt_ans(ll a)//求f([1,a]原创 2018-03-07 15:33:40 · 2122 阅读 · 0 评论