import java.util.*; public class Solution { // 成环即返回false //存储有向图 public ArrayList<ArrayList<Integer>> lists; //节点的状态 0:从未访问过 1:正在访问搜索中 2:访问结束...