随笔分类 - 算法学习
摘要:高精度模板,留个备份: 1 #include 2 #include 3 4 struct BigNumber 5 { 6 static const long long BASE = 1000000000; 7 static const int BASEDIGS =...
阅读全文
摘要:论文足足看了两天,这是成果: 1 #include 2 3 const int maxn = 1000000; 4 5 int n, a, b, c, root; 6 int Child[maxn][2]; 7 int Key[maxn], Size[maxn], Count; ...
阅读全文
摘要:Description暑假期间,小龙报名了一个模拟野外生存作战训练班来锻炼体魄,训练的第一个晚上,教官就给他们出了个难题。由于地上露营湿气重,必须选择在高处的树屋露营。小龙分配的树屋建立在一颗高度为N+1尺(N为正整数)的大树上,正当他发愁怎么爬上去的时候,发现旁边堆满了一些空心四方钢材(如图1.1...
阅读全文
摘要:老是忘记这东西怎么写,在这里记一下。在集合A和集合B中找出最大匹配。 1 int find(int a) 2 { 3 for (int b = 0;b < B;b++) 4 { 5 if (line[a][b] && !vis[b]) 6 ...
阅读全文
摘要:改自n+e的代码 1 #define mx 100010 2 int f[mx], c[mx][2], s[mx]; 3 inline void up (int x) 4 { 5 s[x] = s[c[x][0]] + s[c[x][1]] + 1; 6 } 7 inline int rot...
阅读全文