ACM常用模板 最大团(n小于64)(faster)

/**图灵奖
* WishingBone's ACM/ICPC Routine Library
*
* maximum clique solver
*/
#include <vector>
using std::vector;
// clique solver calculates both size and consitution of maximum clique
// uses bit operation to accelerate searching
// graph size limit is 63, the graph should be undirected
// can optimize to calculate on each component, and sort on vertex degrees
/
/ can be used to solve maximum independent set
class clique {
public:
static const long long ONE = 1;
static const long long MASK = (1 << 21) - 1;
char* bits;
int n, size, cmax[63];
long long mask[63], cons;
// initiate lookup table
clique() {
bits = new char[1 << 21];
bits[0] = 0;
地磁指数预报
for (int i = 1; i < 1 << 21; ++i) bits[i] = bits[i >> 1] + (i & 1);    }
~clique() {
中国急救网delete bits;
}
血管胸// search routine
bool search(int step, int size, long long more, long long con);
时间统计法// solve maximum clique and return size
int sizeClique(vector<vector<int> >& mat);
// solve maximum clique and return constitution
vector<int> consClique(vector<vector<int> >& mat);
};
// search routine
// step is node id, size is current solution, more is available mask, cons is constitution mask
非线性薛定谔方程
bool clique::search(int step, int size, long long more, long long cons) {
if (step >= n) {

本文发布于:2024-09-22 18:21:41,感谢您对本站的认可!

本文链接:https://www.17tex.com/xueshu/470929.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:预报   急救   统计法   指数   中国   时间   地磁
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2024 Comsenz Inc.Powered by © 易纺专利技术学习网 豫ICP备2022007602号 豫公网安备41160202000603 站长QQ:729038198 关于我们 投诉建议