10 2020 档案
摘要:1.前言 我改了好久 2.分析 我们先令一个根节点(1),则这棵树变成了一个棵有根树 我们将(旪)超能力对i的磁场强度分为两种 (1...
阅读全文
摘要:1.证明:任意奇数的平方减1是8的倍数 设这个奇数为 2 ...
阅读全文
摘要:#include #include #define LL long longusing namespace std;const in...
阅读全文
摘要:1.题面 2.前言 太妙了啊太妙了 3.分析 (1).需要的芝士点 在做这道题之前,我们需要知道一个芝士点: ①.结论 Q:一个只判断是否连通的邻接矩阵的 n n n次幂表示什么? A:邻接矩阵 n n n次幂后, a [ i ] [ j ] a[i][j] a[i][j] 表示必须走 n n n步
阅读全文
摘要:1.题面 2.前言 太妙了啊太妙了 3.分析 (1).需要的芝士点 在做这道题之前,我们需要知道一个芝士点: ①.结论 Q:一个只判...
阅读全文
摘要:筛素数 1.暴力筛 #include #include using namespace std;int n, q;bool chec...
阅读全文
摘要:分数 1.基本运算 (+, -, *, /) (重载运算符) LL Abs (LL x) { return x > 0 ? x : ...
阅读全文
摘要:矩阵 1.乘法 struct Matrix { int n, m; LL c[Maxn + 5][Maxn + 5]; Matrix () { memset (c, 0, sizeof c); } void Init () { memset (c, 0, sizeof c); for (int i
阅读全文
摘要:矩阵 1.基本运算(+, -, *) struct Matrix { int n, m; LL c[Maxn + 5][Maxn +...
阅读全文
摘要:背包 01背包 #include using namespace std;const int MAXN = 1005;int n, ...
阅读全文
摘要:最小生成树 prim 1.朴素 #include using namespace std;const int MAXN = 100...
阅读全文
摘要:最短路 floyd #include using namespace std;const int MAXN = 105;const ...
阅读全文
摘要:快速读入 template void read (T &x) { T f = 1; x = 0; char tem = getcha...
阅读全文
摘要:堆 1.插入 void put(int x) { heap[++len] = x; int fa, now = len; while...
阅读全文
摘要:树状数组 1.求lowbit int lowbit(int x) {return x & -x;} 2.更新(pudate) voi...
阅读全文
摘要:求逆序对 1. void merge_sort(int l, int r) { if(l == r) return; int mid...
阅读全文
摘要:离散化 1. #include #include using namespace std;const int MAXN = 1005...
阅读全文
摘要:1.染色问题 (1).环染色问题 ①公式: f ...
阅读全文
摘要:1.题面 2.前言 太妙了啊太妙了 3.分析 大体思路:枚举每一条边,每一条边都对应着两个点 ...
阅读全文
摘要:题面 1.前言 我记得这是上上上…(此处省略多个“上”字) 次考试的题了,结果我思路想到了,但是没打出来(因为我脑子what了,只用...
阅读全文