05 2020 档案
摘要:#Kahn算法 #include<cstdio> #include<iostream> #include<cstring> #include<cmath> #include<stack> using namespace std; const int maxn=10000+5; int n,m,tot
阅读全文
摘要:#include<cstdio> #include<cstring> #include<iostream> #include<cmath> #include<algorithm> #include<queue> using namespace std; const int maxn=1e4+5,IN
阅读全文
摘要:【树形DP】三色二叉树 标签(空格分隔): 树形DP #【题目】 一棵二叉树可以按照如下规则表示成一个由0、1、2组成的字符序列,我们称之为“二叉树序列S”: 0 该树没有子节点 1S1 该树有一个子节点,S1为其二叉树序列 1S1S2 该树有两个子节点,S1,S2分别为两个二叉树的序列 例如,下图
阅读全文
摘要:```#include#include#include#include#includeusing namespace std;const int maxn=3000050;int phi[maxn],prime[maxn],tot;bool notprime[maxn];void isprime(int x){ if(x=2;i--){ if(x%i==0)return 0; } return ...
阅读全文
摘要:``` #include #include #include #include #include #include using namespace std; const int maxn=1e2+50,INF=0x3f3f3f3f; int dx[6]={0,0,-1,0,1},dy[6]={0,-1,0,1,0},n,m,k,sx,sy,ex,ey,a[maxn][maxn],f[maxn],g
阅读全文
摘要:``` #include #include #include #include #include using namespace std; const int maxn=4e5+1000,INF=0x3f3f3f3f; int n,m,a[maxn],lazy[maxn],root,mol,cnt,tot,dfn[maxn],size[maxn],rk[maxn],depth[maxn],son[
阅读全文
摘要:【区间DP】低价回文 标签(空格分隔): 区间DP 回文词 【题目描述】 追踪每头奶牛的去向是一件棘手的任务,为此农夫约翰安装了一套自动系统。他在每头牛身上安装了一个电子身份标签,当奶牛通过扫描器的时候,系统可以读取奶牛的身份信息。目前,每个身份都是由一个字符串组成的,长度为M (1≤M≤2000)
阅读全文
摘要:【二分图】文理分班 标签(空格分隔): 图论 二分图 【前提级】 此文理分班非彼文理分班,如果找的是bzoj的那道文理分班可以绕道了 【题目】 题目描述 jzyz每年的文理分班的时候,每个班都会有一些同学分到其他班,还会进入一些其他班的同学进入这个班。 小x负责安排座位,为了照顾分班带来的那种伤感情
阅读全文