随笔分类 - 图的全家桶/ 最短路/Tarjan强连通/MST/拓扑
摘要:P2746 [USACO5.3]校园网Network of Schools https://www.luogu.org/problem/P2746 题目描述 一些学校连入一个电脑网络。那些学校已订立了协议:每个学校都会给其它的一些学校分发软件(称作“接受学校”)。注意即使 B 在 A 学校的分发列表
阅读全文
摘要:P2341 [HAOI2006]受欢迎的牛|【模板】强连通分量 https://www.luogu.org/problem/P2341 题目描述 每头奶牛都梦想成为牛棚里的明星。被所有奶牛喜欢的奶牛就是一头明星奶牛。所有奶 牛都是自恋狂,每头奶牛总是喜欢自己的。奶牛之间的“喜欢”是可以传递的——如果
阅读全文
摘要:Pursuit For Artifacts "CodeForces 652E " Johnny is playing a well known computer game. The game are in some country, where the player can freely trave
阅读全文
摘要:"D Beautiful Graph" "CodeForces 1093D " You are given an undirected unweighted graph consisting of nn vertices and mm edges. You have to write a numbe
阅读全文
摘要:"E We Need More Bosses" "CodeForces 1000E " Your friend is developing a computer game. He has already decided how the game world should look like — it
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/392/I 来源:牛客网 华华和月月逛公园 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 32768K,其他语言65536K 64bit IO Format: %lld 题目描述 月月和华华一起去逛公园了
阅读全文
摘要:题目链接 :http://acm.hdu.edu.cn/showproblem.php?pid=6670 Mindis Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Total S
阅读全文
摘要:C. Anna, Svyatoslav and Maps time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output The main charac
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/904/E 来源:牛客网 DongDong数颜色 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 524288K,其他语言1048576K 64bit IO Format: %lld 题目描述 DongDo
阅读全文
摘要:You are given a rooted tree with root in vertex 1. Each vertex is coloured in some colour. Let's call colour c dominating in the subtree of vertex v i
阅读全文
摘要:Recently, Shua Shua had a big quarrel with his GF. He is so upset that he decides to take a trip to some other city to avoid meeting her. He will trav
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/904/D 来源:牛客网 DongDong坐飞机 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 524288K,其他语言1048576K 64bit IO Format: %lld 题目描述 愿时间过得慢
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/160/B 来源:牛客网 题目描述 给一个含n个点m条边的有向无环图(允许重边,点用1到n的整数表示),每条边上有一个字符,问图上有几条路径满足路径上经过的边上的字符组成的的字符串去掉空格后以大写字母开头,句号 '.' 结
阅读全文
摘要:Every person likes prime numbers. Alice is a person, thus she also shares the love for them. Bob wanted to give her an affectionate gift but couldn't
阅读全文
摘要:D. Maximum Diameter Graph time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Graph constructive
阅读全文
摘要:一个链接:https://ac.nowcoder.com/acm/contest/82/E来源:牛客网 无向图中的最短距离 无向图中的最短距离 时间限制:C/C++ 2秒,其他语言4秒 空间限制:C/C++ 262144K,其他语言524288K 64bit IO Format: %lld 题目描述
阅读全文
摘要:思路: 我们看条件,发现满足条件的子图无非就是一些环构成的图, 因为只有形成环,才满足边的两个点都在子图中,并且子图中节点的度是大于0的偶数。 那么如果当前有k个环,我们可以选2^k-1个子图,为什么? 我们从这k个环中选择 1~n个都可以满足条件,那么就是C(k,1)+C(k,2)+C(k,3)+
阅读全文
摘要:题目描述 爬山是wlswls最喜欢的活动之一。 在一个神奇的世界里,一共有nn座山,mm条路。 wlswls初始有kk点体力,在爬山的过程中,他所处的海拔每上升1m1m,体力会减11点,海拔每下降1m1m,体力会加一点。 现在wlswls想从11号山走到nn号山,在这个过程中,他的体力不能低于00,
阅读全文
摘要:There are nn cities and mm roads in Berland. Each road connects a pair of cities. The roads in Berland are one-way. What is the minimum number of new
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/330/G来源:牛客网 Applese 的毒气炸弹 Applese 的毒气炸弹 时间限制:C/C++ 2秒,其他语言4秒 空间限制:C/C++ 262144K,其他语言524288K 64bit IO Format: %l
阅读全文

浙公网安备 33010602011771号