摘要:
题意:求有向图里面有多少个三元环。 思路:枚举起点A,遍历A可以到的B,然后求C的数量,C的数量位B可以到是地方X集合,和可以到A的地方Y集合的交集(X&Y)。 B点可以枚举,也可以遍历。(两种都试过,区别不大。) 枚举代码: 遍历代码: 阅读全文
摘要:
You are given N sets, the i-th set (represent by S(i)) have C(i) element (Here "set" isn't entirely the same as the "set" defined in mathematics, and 阅读全文