位运算
white Era
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
xay loves or
位运算位运算。。。 AC代码: #include <iostream> #include <stdio.h> #include <stdlib.h> #include <math.h> using namespace std; typedef long long ll; int main(){ ll x,s; while(~scanf("%lld%lld",&x,&s)){ ll ans = .原创 2021-08-08 15:01:06 · 161 阅读 · 0 评论 -
求一个序列全部子集
下面的是二进制法,第一个是数字版的,第二个是非连续数字版的 解释看代码 #include <iostream> #include <string> using namespace std; int main(){ int n; cin >> n; for(int i = 0;i<(1<<n);i++){ //因为1-n的子集有2^n个 int cnt = 0; //用来控制格式输出的 cout << "{原创 2021-08-04 21:44:22 · 235 阅读 · 0 评论 -
Co-growing Sequence
题目:https://codeforces.com/contest/1547/problem/D Co-growing Sequence A sequence of non-negative integers a1,a2,…,an is called growing if for all i from 1 to n−1 all ones (of binary representation) in ai are in the places of ones (of binary representation)原创 2021-07-22 21:26:14 · 395 阅读 · 0 评论
分享