You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.4 KiB

2 years ago
#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
int main() {
/**
https://blog.csdn.net/weixin_41183791/article/details/84886700
1. x>>1
2.0 x<<1
3.1 (x<<1)+1
4.1 x|1
5.0 (x|1)-1
6. x^1
7.k1 x|(1<<(k-1))
8.k0 x&~(1<<(k-1))
9.k x^(1<<(k-1))
10. x&7
11.k x&(1<<(k-1))
12.k x>>(k-1)&1 //右移k位再与1一下就知道这位是1是0了
13.k1 x|(1<<k-1)
14.k x^(1<<k-1)
15.10 x&(x+1)
16.01 x|(x+1)
17.01 1|(x-1)
18.1 (x^(x+1))>>1
19.1 x&(x^(x-1))
1
a & 1 =1 a & 1 =0
2k0 x&~(1<<(k-1))
3k x^(1<<k-1)
4k10 x>>(k-1)&1
501 x|(x+1)
*/
return 0;
}