#include<stdio.h> #include<string.h> #include<queue> using namespace std; #define N 200 struct node { int u,v,next; } bian[N*N]; int n,dfn[N],low[N],stac[N],yong,head[N],visit[N],ans,top,inde,suo[N],indegree[N],outdegree[N]; void init()…
#include<stdio.h>//求出其所有的强连通分量缩点,选出出度和入度最大的那个就是要求的边 #include<string.h> #include<stdlib.h> #define N 51000 struct node { int v,next; }bian[N]; int head[N],yong,n,indegree[N],outdegree[N],visit[N],suo[N],dfn[N],f,low[N],index,stac[N],top;…
The King’s Problem Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2259 Accepted Submission(s): 795 Problem Description In the Kingdom of Silence, the king has a new problem. There are N citi…
Hawk-and-Chicken Time Limit: 6000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3321 Accepted Submission(s): 1041 Problem Description Kids in kindergarten enjoy playing a game called Hawk-and-Chicken. But t…
题目链接 题意是说在几个邮局之间传送一份信件,如果出发点和终止点在同一个国家传递,则时间为0,否则让你求花费最少时间,如果不能传到,则输出Nao e possivel entregar a carta.判断邮局是否在同一个国家的依据是发出的信件可以相互到达. 如果直接求最短路则无法判断两个邮局是否在同一个国家,判断两个邮局是否属于同一个国家的标志是在这个国家邮局间可以相互到达,那么这就是强连通了,所以要先缩点判读邮局是否在同一个国家,如果不是,则重新建图,建图的时候要维护好边权,求出最短边权,在…