热门搜索: 个人免签支付 素材网站源码 图片素材站源码 游戏源码 js广告 jquery选项卡 jQuery导航
2021-03-08 13:27
标签:math std 异或 queue size query break mes 线性 #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; const int N = 5e4 + 105; const int mod = 10000; const int P = 9999; const double Pi = acos(- 1.0); const int INF = 0x3f3f3f3f; inline int read() { char ch = getchar(); int x = 0, f = 1; while (ch ‘9‘) { if (ch == ‘-‘) f = -1; ch = getchar(); } while (‘0‘ = 0; -- i) if(val & (1ll = 0; -- i){ ll che = res ^ lba[i]; if(che > res) res^=lba[i]; } return res; } }; //图论基本模板 struct Edge{ int to; ll c; int nxt; }edge[N * 4]; int head[N], cnt = 0; int n, m; inline void add(int u, int v, ll w){ edge[cnt].to = v; edge[cnt].c = w; edge[cnt].nxt = head[u]; head[u] = cnt ++; } //main() ll res; int vis[N]; L_B lb; ll dis[N]; void dfs(int u, int pre){ vis[u] = 1; for(int i = head[u]; i != -1; i = edge[i].nxt){ int v = edge[i].to; ll w = edge[i].c; if(v == pre) continue; if(vis[v]){ lb.Insert(w ^ dis[u] ^ dis[v]); continue; } dis[v] = dis[u] ^ w; dfs(v, u); } } int main() { scanf("%d%d",&n,&m); memset(head, -1, sizeof(head)); for(int i = 1; i ACwing.228 异或(线性基) 标签:math std 异或 queue size query break mes 线性 原文地址:https://www.cnblogs.com/A-sc/p/12791225.html
标签:math std 异或 queue size query break mes 线性
#include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; const int N = 5e4 + 105; const int mod = 10000; const int P = 9999; const double Pi = acos(- 1.0); const int INF = 0x3f3f3f3f; inline int read() { char ch = getchar(); int x = 0, f = 1; while (ch ‘9‘) { if (ch == ‘-‘) f = -1; ch = getchar(); } while (‘0‘ = 0; -- i) if(val & (1ll = 0; -- i){ ll che = res ^ lba[i]; if(che > res) res^=lba[i]; } return res; } }; //图论基本模板 struct Edge{ int to; ll c; int nxt; }edge[N * 4]; int head[N], cnt = 0; int n, m; inline void add(int u, int v, ll w){ edge[cnt].to = v; edge[cnt].c = w; edge[cnt].nxt = head[u]; head[u] = cnt ++; } //main() ll res; int vis[N]; L_B lb; ll dis[N]; void dfs(int u, int pre){ vis[u] = 1; for(int i = head[u]; i != -1; i = edge[i].nxt){ int v = edge[i].to; ll w = edge[i].c; if(v == pre) continue; if(vis[v]){ lb.Insert(w ^ dis[u] ^ dis[v]); continue; } dis[v] = dis[u] ^ w; dfs(v, u); } } int main() { scanf("%d%d",&n,&m); memset(head, -1, sizeof(head)); for(int i = 1; i
ACwing.228 异或(线性基)
原文地址:https://www.cnblogs.com/A-sc/p/12791225.html
上一篇:创建第一个WEB API程序
下一篇:C#常用方法——通过WebServices接口读取json字符并解析示例