04 2022 档案
摘要:尼姆博弈:n堆物品,两人轮流取,每次从某堆中取最少一个,最后取完者胜 结论:将n堆物品全部异或后结果为0,则先手必败,否则必胜 威佐夫博弈:有两堆各若干个物品,两人轮流从任意一堆中取出至少一个或者同时从两堆中取同样多的物品,规定每次至少取一个,至多不限,最后取光者胜利 结论:(黄金分割比)首先求出差
阅读全文
摘要:#include<iostream> #include<cstring> #include<algorithm> #include<cstdio> #include<cmath> #define x first #define y second using namespace std; const
阅读全文
摘要:[this is](TSP问题+例题 - 快乐的黄鳝 - 博客园 (cnblogs.com))
阅读全文
摘要:左值:在表达式中能作为左边元素的值 int a; int& b=a int& c=10; //错误,不能对右值添加引用,因此称呼'&'为左值引用,只能引用左值 const int & c=10; //可以,const左值引用可以对右值进行引用 //为解决这个问题,引入右值引用'&&' int &&
阅读全文
摘要:csdn 参数取用方式 ...mutable可以取消默认const... throw() → bool(返回值类型) {函数体}(参数值列表)
阅读全文
摘要:在完备匹配的基础上实现边权最大(KM算法) 如果不是完备匹配可以用费用流 blog 洛谷 AC #include <algorithm> #include <cstring> #include <cstdio> #include <iostream> using namespace std; con
阅读全文
摘要:洛谷 #include<bits/stdc++.h> using namespace std; const int N = 50005, M = 50000 * 2 + 5; int h[N], e[M], ne[M], flow[M], cost[M], idx; int n, m, S, T;
阅读全文
摘要:dinic算法 blog #include <iostream> #include <cstdio> #include <queue> #include <cstring> using namespace std; /* 维护一个残余网络,c[i]表示正向残余流, c[i^1]表示反向残余流*/ c
阅读全文
摘要:匈牙利算法 AC #include <iostream> #include <cstring> #include <algorithm> using namespace std; const int N = 510, M = 100010; int h[N], e[M], ne[M], idx; i
阅读全文
摘要:XMUOJ # include <bits/stdc++.h> using namespace std; #define MAXSIZE 100001 vector<vector<int> > adj(MAXSIZE); int w[MAXSIZE]; int main() { int n, k,
阅读全文
摘要:即是求ab+ac+...+bc+bd+...+cd+ce+...+(n-1)*n 合并石头
阅读全文
摘要:教学视频+qq群+微信群 2.由上面的群搜集资源 3.入手练习 4.参加小竞赛 5.写心得 6.啃书 7.参加中竞赛 8.接下来咋学都行
阅读全文
摘要:本质:在一个序列中,从初始到某位为止,总有A出现次数的和(>=)B出现次数的和 火车进出栈
阅读全文
摘要:其实static没这么复杂,只要记住,在static中没有this指针,一切基于this指针的操作都不能实现,当然,可以在static函数中创建另一个对象,再用该对象名任意调用非static函数
阅读全文
摘要:记录Max1,Max2,up,而后便可以得出用经过每个点的最大(小)路径 leecode class Solution { public: vector<vector<int>> g; vector<int> d1, d2, p1, p2, up; void dfs1(int u, int fath
阅读全文