#include<bits/stdc++.h> using namespace std; #define int long long namespace yspm{ inline int read() { int res=0,f=1; char k; while(!isdigit(k=getchar ...
分类:
其他好文 时间:
2020-07-27 23:34:24
阅读次数:
65
dfs连通性模型 1. 算法分析 使用dfs来判断是否两个点连通,也可以通过dfs来做计数 2. 例题 acwing1112迷宫 T个测试样例,每个测试样例输入一个N,表示网格大小。网格为N*N的二维网格,给定起点和终点,问起点能否到达终点 #include <bits/stdc++.h> usin ...
分类:
其他好文 时间:
2020-07-27 13:38:39
阅读次数:
73
#include<bits/stdc++.h>#define ll long long#define speed_up ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);using namespace std;const ll nl=1e5+5;/ ...
分类:
其他好文 时间:
2020-07-27 09:31:11
阅读次数:
66
#include<bits/stdc++.h>#define ll long long#define speed_up ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);using namespace std;const ll nl=1e5+5;/ ...
分类:
其他好文 时间:
2020-07-26 23:23:20
阅读次数:
105
跳石头 简单的二分答案,贪心地判断解 #include<bits/stdc++.h> #define fi first #define se second #define pb push_back #define mp make_pair #define SZ(x) ((int)x.size()) ...
分类:
其他好文 时间:
2020-07-26 23:05:34
阅读次数:
73
结构体内的一些操作 重载 #include <bits/stdc++.h> using namespace std; struct test { int a, b; friend bool operator < (const test &x, const test &y) { return x.a ...
分类:
其他好文 时间:
2020-07-26 23:02:39
阅读次数:
72
P3804 【模板】后缀自动机 (SAM) 参考: 不同子串个数 用d[i]来表示该状态点是否为终止点,最后利用每个点的后缀链接形成一棵树,每个点所表示的最长字符串都是其子树中各节点的最长公共后缀。 // Created by CAD #include <bits/stdc++.h> using n ...
分类:
其他好文 时间:
2020-07-26 19:05:13
阅读次数:
52
1,sorted 函数sorted 函数语法:sorted (iterable,key,reverse),一共有iterable,key,reverse这三个参数。 iterable表示可以迭代的对象,例如可以是dict.items()、dict.keys()等; key是一个函数,用来选取参与比较 ...
分类:
编程语言 时间:
2020-07-26 15:18:18
阅读次数:
67
Dinic模板 #pragma GCC optimize(2) #include <bits/stdc++.h> using namespace std; const int maxn = 1e5 + 10; //const int maxm = 1e3 * 2 + 10; const int in ...
分类:
其他好文 时间:
2020-07-26 01:58:19
阅读次数:
59
1、常用的装饰器有:before_request、after_request(这两个装饰器有点类似于django的中间件组件) 源码: 1 def preprocess_request(self): 2 """Called before the request is dispatched. Call ...
分类:
其他好文 时间:
2020-07-26 01:48:46
阅读次数:
61