题目描述 In this problem, we would like to talk about unreachable sets of a directed acyclic graph G = (V, E). In mathematics a directed acyclic graph (DAG) is a directed graph with no directed cycles. That is a graph such that there is no way to start a…
In this problem, we will define a graph called star graph, and the question is to find the minimum distance between two given nodes in the star graph. Given an integer nnn, an n−dimensionaln-dimensionaln−dimensional star graph, also referred to as Sn…
There are nnn rectangles on the plane. The problem is to find the area of the union of these rectangles. Note that these rectangles might overlap with each other, and the overlapped areas of these rectangles shall not be counted more than once. For e…
Let SSS be a sequence of integers s1s_{1}s1, s2s_{2}s2, ........., sns_{n}sn Each integer is is associated with a weight by the following rules: (1) If is is negative, then its weight is 000. (2) If is is greater than or equal to 10000100001…
You are given a list of train stations, say from the station 111 to the station 100100100. The passengers can order several tickets from one station to another before the train leaves the station one. We will issue one train from the station 111 to t…