1 2 3 4

10 2019 档案

摘要:#include<cstring> #include<iostream> #include<cstdio> #include<queue> #include<algorithm> #define maxn 200200 using namespace std; typedef long long ll; int par[maxn]; ll num[maxn]; int find(int x) { 阅读全文
posted @ 2019-10-31 16:11 Lesning 阅读(585) 评论(0) 推荐(0) 编辑
摘要:周末牛客挂了个更难的,这个简单一些 阅读全文
posted @ 2019-10-30 15:15 Lesning 阅读(238) 评论(0) 推荐(0) 编辑
摘要:挺简单的一个dp 阅读全文
posted @ 2019-10-29 21:15 Lesning 阅读(171) 评论(0) 推荐(0) 编辑
摘要:#include #include #include #include #include #define maxn 5000100 using namespace std; typedef long long ll; ll tree[maxn]; ll arr[maxn]; int vis[maxn]; int root = 1; int push_down(int node, int... 阅读全文
posted @ 2019-10-29 14:07 Lesning 阅读(149) 评论(0) 推荐(0) 编辑
摘要:刚开始想了两个小时,打算把区间分块然后计算,但是这就很灵性了看了一个大佬的博客,侵删 阅读全文
posted @ 2019-10-27 19:15 Lesning 阅读(171) 评论(0) 推荐(0) 编辑
摘要:按照《算法竞赛进阶指南》写的 哦对了,注意下最后判断,因为开始拓扑的时候,s可能不在里边,所以不一定等于INF,而是应该大于等于INF 阅读全文
posted @ 2019-10-26 15:13 Lesning 阅读(226) 评论(0) 推荐(0) 编辑
摘要:典型树上dp,直接暴力算会超时,小心呀 阅读全文
posted @ 2019-10-26 14:32 Lesning 阅读(155) 评论(0) 推荐(0) 编辑
摘要:bfs第一次写崩了,超时到怀疑人生 阅读全文
posted @ 2019-10-24 22:14 Lesning 阅读(174) 评论(0) 推荐(0) 编辑
摘要:#include<iostream> #include<cstring> #include<cstdio> #include<algorithm> #include<queue> #include<vector> #define maxn 300100 using namespace std; const int N = 110; const int base = 20010; int n, k, 阅读全文
posted @ 2019-10-23 21:45 Lesning 阅读(132) 评论(0) 推荐(0) 编辑
摘要:#include #include #include #include using namespace std; typedef long long ll; ll list[200010]; ll ans[200010]; ll g[200010]; ll f[200010]; int n,c; int main(){ scanf("%d %d",&n,&c); for(int i... 阅读全文
posted @ 2019-10-23 18:41 Lesning 阅读(160) 评论(0) 推荐(0) 编辑
摘要:学到了一份排列组合的公式 阅读全文
posted @ 2019-10-23 13:36 Lesning 阅读(264) 评论(0) 推荐(0) 编辑
摘要:推公式题,万万没想到斐波那契啊 阅读全文
posted @ 2019-10-22 14:31 Lesning 阅读(210) 评论(0) 推荐(0) 编辑
摘要:链接:https://ac.nowcoder.com/acm/contest/959/H来源:牛客网 C国有n个大城市和m条道路,每条道路连接这n个城市中的某两个城市。任意两个城市之间最多只有一条道路直接相连。这m条道路中有一部分为单向通行的道路,一部分为双向通行的道路,双向通行的道路在统计条数时也 阅读全文
posted @ 2019-10-21 19:27 Lesning 阅读(204) 评论(0) 推荐(0) 编辑
摘要:真的不会写的,累了,这题实在是太难了QAQ 阅读全文
posted @ 2019-10-17 11:49 Lesning 阅读(65) 评论(0) 推荐(0) 编辑
摘要:#include<cstdio> #include<iostream> #include<cstring> #include<algorithm> #include<vector> #define maxn 2100 using namespace std; vector<int>G[maxn]; void insert(int be, int en) { G[be].push_back(en); 阅读全文
posted @ 2019-10-12 18:48 Lesning 阅读(389) 评论(0) 推荐(0) 编辑
摘要:利用树形DP可以有效解决该问题! 阅读全文
posted @ 2019-10-09 19:20 Lesning 阅读(446) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2019-10-08 19:51 Lesning 阅读(154) 评论(0) 推荐(0) 编辑
摘要:#include<cstring> #include<iostream> #include<cstring> #include<queue> #include<vector> #define maxn 100010 using namespace std; const long long mod = 1000000000 + 7; typedef long long ll; int de[maxn 阅读全文
posted @ 2019-10-07 21:51 Lesning 阅读(469) 评论(0) 推荐(0) 编辑
摘要:我想说说双联通分量还有割点和桥 1.割点(一个点,如果没有这一个点,图就会变得不连通) 2.桥(一条边,断开这条边就会让图不连通) 3.点双连通(没割点的图) 4.边双连通(没桥的图) 5.割点之间不一定有桥!!! 6.桥两端不一定是割点!!! 对了,关于tarjan我还想再说说 就像下图,圈住的是 阅读全文
posted @ 2019-10-06 18:01 Lesning 阅读(188) 评论(0) 推荐(0) 编辑
摘要:传送门 https://ac.nowcoder.com/acm/contest/1109#question 刚开始吓得我以为要搞树分治,差点就捞了哦! 这个定理要铭记于心啊!!! 阅读全文
posted @ 2019-10-04 20:25 Lesning 阅读(163) 评论(0) 推荐(0) 编辑
摘要:这道题挺难的,可以加深对割点的理解,还有,排列组合好重要了,分连通块,然后乘法原理(加法原理计数什么的) 传送门 https://www.luogu.org/problem/P3225 省选oi题好难啊QAQ 阅读全文
posted @ 2019-10-04 10:51 Lesning 阅读(142) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示