# Tag-bitset

Icontofig 's Blog // 我们的征程是星辰大海！Away From OI，Come to ICPC（查看友链请点About Me）

## 代码

```#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 998244353;
ll quick_pow(ll x,ll y){
ll res = 1;
while(y){
if(y & 1)
res = res * x % mod;
x = x * x % mod;
y >>= 1;
}
return res;
}
const int maxn = 205;
int a[maxn][maxn],b[maxn][maxn];
bitset<maxn>bs[maxn],bd[maxn],t;
int n;
ll ans;
void swap(bitset<maxn> &x,bitset<maxn> &y){
t.reset();
t |= y;
y.reset();
y |= x;
x.reset();
x |= t;
return;
}
int Guass(){
int maxrow,row = 0,col = 0,num = 0;
for(row = 0;row < n && col < n;row++,col++){
maxrow = row;
for(int i = row + 1;i < n;++i){
```

## 题解

curi = ((curi+1 >> 1) | Im) & sposi。posi表示最后一个小于等于A[i]的B[posi]。

## 代码

```#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int>PI;
const int maxn = 150005;
const int maxm = 40005;
PI a[maxn],b[maxm];
bitset<maxm>s[maxm];
bitset<maxm>cur,upd;
const int INF = 1e9+7;
int n,m;
int p;
int main(){
ios_ba```

## 题解

x1v1 + x2v2 + ... + xnvn = 0有解。

xxor x2 xor ... xor xn = 1

## 代码

```#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1505;
bitset<maxn>g[maxn];
int n,k,now,x;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cin >> n >> k;
for(int i = 1;i <= n;++i){
for(int j = 1;j <= k;++j){
cin >> x;
g[j][i] = abs(x) % 2;
}
}
for(int i = 1;i <= n+1;++i){
g[k+1][i] = 1;
}
now = 0;
for(int i = 1;i <= n;++i){
int j```

## 题解

mp[k][v] = mp[k][u]; ----> mp[k][v] |= mp[k][u];

## 代码

```#include <bits/stdc++.h>
using namespace std;
const int maxn = 305;
int d[maxn],tmp[maxn];
bitset<305>con[maxn];
queue<int>qk;
vector<int>g[maxn];
int n,m,q;
int a,b;
int c[maxn],vis[maxn];
void topsort(){
for(int i = 1;i <= n;++i)
con[i].reset();
for(int i = 1;i <= n;++i){
if(!c[i])
con[i][i] = 1;
vis[i] = 0;
}
for(int i = 1;i <= n;++i){
tmp[i] = d[i];
```

## 题解

dp[i][j] = dp[i-1][j] + (dp[i-1][(j-lg[a[i]])%2016]);

dp[i][j] = dp[i-1][j] ^ (dp[i-1][(j-lg[a[i]])%2016]);（二进制中的异或运算实际上就是加法对2取模）

f ^= (f<<lg[a[i]]) ^ (f>>(2016-lg[a[i]]));

## 代码

```#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 1e9+7;
int lg[2020],a[2000005],n,r;
bitset<2016>f;
int main(```
Title - Artist
0:00