HDU 1824 Let's go home(2-SAT+Tarjan)】的更多相关文章

I - pog loves szh III Time Limit:6000MS     Memory Limit:131072KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 5266 Description Pog and Szh are playing games. Firstly Pog draw a tree on the paper. Here we define 1 as the root of the t…
HDU 1565 1569 方格取数(最大点权独立集) 题目链接 题意:中文题 思路:最大点权独立集 = 总权值 - 最小割 = 总权值 - 最大流 那么原图周围不能连边,那么就能够分成黑白棋盘.源点连向黑点.白点连向汇点,容量都为点容量.然后黑白之间相邻的就连一条容量无限大的边 代码: #include <cstdio> #include <cstring> #include <queue> #include <algorithm> using names…
pid=5145">[HDU 5145] NPY and girls(组合+莫队) NPY and girls Time Limit: 8000/4000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 593    Accepted Submission(s): 179 Problem Description NPY's girlfriend blew him out!H…
[Luogu3731][HAOI2017]新型城市化(网络流,Tarjan) 题面 洛谷 给定一张反图,保证原图能分成不超过两个团,问有多少种加上一条边的方法,使得最大团的个数至少加上\(1\). 题解 本来并不会做的,看题解第一句话就会了QwQ 对于在反图上没有边的点之间是存在一条边的. 那么考虑原图的一个团对应在反图上是什么,因为原图的团内的点两两之间有边,所以对应在反图上两两之间无边.所以原图的一个团对应着反图的一个独立集. 因为原图可以分解为不超过\(2\)个团,所以反图可以分解成一个二…
Let's go home Time Limit: 10000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1940    Accepted Submission(s): 821 Problem Description 小时候,乡愁是一枚小小的邮票,我在这头,母亲在那头.                         —— 余光中 集训是辛苦的,道路是坎坷的,休息…
不容易系列之一 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 18134    Accepted Submission(s): 7551 Problem Description 大家常常感慨,要做好一件事情真的不容易,确实,失败比成功容易多了! 做好“一件”事情尚且不易,若想永远成功而总从不失败,那更是难上加难了,就像花钱总是比挣钱容…
CRB and His Birthday Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 430    Accepted Submission(s): 237 Problem Description Today is CRB's birthday. His mom decided to buy many presents for her…
Problem Description The sky was brushed clean by the wind and the stars were cold in a black sky. What a wonderful night. You observed that, sometimes the stars can form a regular polygon in the sky if we connect them properly. You want to record the…
BUPT2017 wintertraining(15) #8E 题意 长度为n(\(n<2^{63}\))的绳子,每隔长度L(1<L<n)做一次标记,标记值就是L,L是n的约数. 每轮标记都选一个L,且L之间两两互质. 求L的最多种数K.以及标记之和S的最大值. 题解 对n进行分解质因数,K就是不同质因子的个数,S就是p^{a_i}之和.不过题目要求L<n,所以当S算出来是n时,再除以一下最小的质因子. 分解比较小的n(<1e9),可以直接枚举,复杂度是\(O(\sqrt n…
传送门: 改革春风吹满地 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 42663    Accepted Submission(s): 21856 Problem Description “ 改革春风吹满地,不会AC没关系;实在不行回老家,还有一亩三分地.谢谢!(乐队奏乐)” 话说部分学生心态极好,每天就知道游戏,这次考试如此简单的题…