有趣啊 先spfa分别求出以s1,t1,s2,t2为起点的最短路,然后把在s1-->t1或者s2-->t2最短路上的边重新建有向图,跑拓扑最长路即可 #include<iostream> #include<cstdio> #include<cstring> #include<queue> #include<vector> using namespace std; const int N=1505,inf=1e9; int n,m,x1…
Legal or Not Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6580 Accepted Submission(s): 3088 Problem Description ACM-DIY is a large QQ group where many excellent acmers get together. It is…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2647 Problem Description Dandelion's uncle is a boss of a factory. As the spring festival is coming , he wants to distribute rewards to his workers. Now he has a trouble about how to distribute the rewar…