文章分类 -  OI题目

上一页 1 ··· 4 5 6 7 8 9 10 11 12 下一页
摘要::::若 add(0,i) 会影响缩点 :::add2-> 缩点 (单个点 也可以是 缩点 ) 然后构造0 ->构造树 #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<bits/st 阅读全文
posted @ 2023-08-15 00:29 JMXZ
摘要::::边 <<1 否则会TLE #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<bits/stdc++.h> #define ll long long #define ddd pri 阅读全文
posted @ 2023-08-14 09:32 JMXZ
摘要:>>>加 减 乘 覆盖 都有优先级 优先级高的影响优先级低的 要泾渭分明 互不干扰 >>>query change area_ ->pushdown >>>更改查询范围 都在 k 结点的范围 就直接 lazzy tag 标记 节省时间 若不 则 pushdown >>>每一个结点的lazy tag 阅读全文
posted @ 2023-08-13 16:23 JMXZ
摘要::::easy->easy #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<bits/stdc++.h> #define ll long long #define ddd print 阅读全文
posted @ 2023-08-13 13:23 JMXZ
摘要::::行列关系 反复 检查 #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<bits/stdc++.h> #define ll long long #define ddd print 阅读全文
posted @ 2023-08-13 13:11 JMXZ
摘要:>>>可以从任何一个顶点开始装篱笆,也可以从任何一个顶点坐船到另一个岛的某个顶点上,从这个顶点开始把该岛屿的篱笆全都装好,然后马上坐船原路返回 + 岛内不花费 -》从一节点反复出发 遍历 路径最小值 >>>Tarjan缩点+枚举边最小值,强连通分量 +Ans最后要乘二 :::非全局变量 初始化 #i 阅读全文
posted @ 2023-08-13 10:18 JMXZ
摘要:#include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<bits/stdc++.h> #define ll long long #define ddd printf(" debug\n"); 阅读全文
posted @ 2023-08-13 08:55 JMXZ
摘要::::单向边不需要 判断边的fa :::f[i][j]->i root i的 选中 j 个的最大值 including i f[i][0]=0; #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #in 阅读全文
posted @ 2023-08-12 23:21 JMXZ
摘要:#include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<bits/stdc++.h> #define ll long long #define ddd printf(" debug\n"); 阅读全文
posted @ 2023-08-12 22:29 JMXZ
摘要:>>>状态压缩dp >>>转移方程 只要 意义对, 没有的 皆是0/INF ->满足条件 #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<bits/stdc++.h> #define 阅读全文
posted @ 2023-08-12 13:37 JMXZ
摘要:#include<bits/stdc++.h> using namespace std; int v,n,t; int x; int g[205][205]; int i,j,k; int w[10001],z[10001]; int b[10001]; int dp[10001]; int mai 阅读全文
posted @ 2023-08-12 09:06 JMXZ
摘要:#include<bits/stdc++.h> #define up(l,r,i) for(int i=l,END##i=r;i<=END##i;++i) #define dn(r,l,i) for(int i=r,END##i=l;i>=END##i;--i) using namespace st 阅读全文
posted @ 2023-08-11 12:00 JMXZ
摘要::::语言要多练-> dfs 回溯时 从小到大 迭代 省一次dfs :::dfs / 树型结构-> vis[] ->节省不必要 搜索 //编写代码是== -》= ->>TLE 编译器·停止 //1.递归 ER 2.溢出 3. == 重复定义 /* 10 10 517 626 565 502 512 阅读全文
posted @ 2023-08-11 10:26 JMXZ
摘要:>>> 题意很清楚,求图中最小的环。 如果一个人的入度为0,则肯定不可能成环,那么把这个人和他连出的边删去(即标记这个人并将他下一个人的入度减 1), 如果下一个人的入度为0则将他也删去……最后把所有入度为0的人都删去了,剩下的都是环。 每个人的出度为1,所以每个人只能在一个环中,每条边只能在一个环 阅读全文
posted @ 2023-08-11 09:20 JMXZ
摘要:>>>人是按照 时间顺序进队的 >>>people -> time + ki >>>人的数据规模< ->桶排序 #include<bits/stdc++.h> using namespace std; int s,i=0,n,t,k,r,w[100001],x[300002],y[300002]; 阅读全文
posted @ 2023-08-10 18:28 JMXZ
摘要::::连边时 sm->big 单向边 #include<iostream> #include<cstdio> #include<cmath> #include<string> #include<algorithm> #include<queue> using namespace std; bool 阅读全文
posted @ 2023-08-10 17:17 JMXZ
摘要::::只有偶数坐标才能 符合要求 因为 2*r 全覆盖 :::s+1~e-1 是保证连续性 :::e=s+1 则保留 #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<bits/std 阅读全文
posted @ 2023-08-10 14:29 JMXZ
摘要:>>>不在x->y路径上的 mid point 的旁生点 >>>1. mid point == LCA -> siz[1]-siz[LCA->x]-siz[LCA->y] -> dep[x]==xep[y] >>>2. mp!=LCA ->先到LCA再计算 siz[mp]-siz[mp->x] (m 阅读全文
posted @ 2023-08-10 10:08 JMXZ
摘要:>>> 然后发现颜色范围好像只有30; 所以,我就想到一种sao操作,搞30颗线段树。 每颗线段树代表一种颜色。 那么对于题中的两种操作: 1.修改。我们for循环扫一遍所有颜色,把其他颜色的线段树l->r修改成0,要修改的颜色所对应的线段树改成1。 2.询问。也是for循环,如果l->r这个区间的 阅读全文
posted @ 2023-08-10 00:47 JMXZ
摘要:>>> /3 -> 遍历一遍就可以了 #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<bits/stdc++.h> #define ll long long #define ddd 阅读全文
posted @ 2023-08-09 23:19 JMXZ

上一页 1 ··· 4 5 6 7 8 9 10 11 12 下一页