😀 算法标签:二进制 |
求出对于给到的和,存在多少个满足。
首先考虑恒为的情况:的某一位为,的对应位为。
再考虑的情况种数:统计和同一位都为的位数,同时为,那么对于该位就有两种选择:然后输出即可。
喜提WA…再读题,正整数。。。
考虑什么时候会出现这种及其特殊的数字:的某一位为,的对应位为,此时一定会出现取0的情况。单独挑出来即可。
😀 算法标签:二进制 |
求出对于给到的和,存在多少个满足。
首先考虑恒为的情况:的某一位为,的对应位为。
再考虑的情况种数:统计和同一位都为的位数,同时为,那么对于该位就有两种选择:然后输出即可。
喜提WA…再读题,正整数。。。
考虑什么时候会出现这种及其特殊的数字:的某一位为,的对应位为,此时一定会出现取0的情况。单独挑出来即可。
上一篇:数据结构 ST表 详解
下一篇:8.数列分块入门 8
二进制安装docker
传送门思路:去重排序并记录每个数的个数,对于i和j对应的相同的数a,ans+=a的数量∗a
灵活运用位运算解决问题。
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M