ption e) {. println ("File not found");
} finally {. close (); (pw! = null) {. close ();
}
}
} static void rec (int step) {(step == stocks.size ()) {= new StringBuilder ();. append ("{"); (Integer integer: ans) {. append (integer + ",");
}. delete (sb.lastIndexOf (","), sb.length ());. append ("}");. println (sb);;
} (Integer el: stocks.get (step)) {. add (el); (step + 1);. remove (el);
}
}
}
ans = new ArrayList (); static PrintWriter pw = null; static List > stocks = new ArrayList > (); static void main ( String [] args) {
Scanner scanner = null;
Map > componentsReachability = new HashMap > ();
Map , List > reachabilityBySCC = new HashMap , List > (); f; = true; {= new Scanner ( new File ("input.txt")); = scanner.nextInt (); [] [] adjacencyMatrix = new int [topCount] [topCount]; (inti = 0; i
}
} [] [] reachabilityMatrix = Matrix.getReachabilityMatrix (adjacencyMatrix, topCount); (inti = 0; i () ); (int j = 0; j
}
}
} (inti = 0; i
f = false;
List key = componentsReachability.get (i + 1); (List list: reachabilityBySCC.keySet ()) {(list.equals (key)) {
f = true;;
}
} (f) {. get (key). add (i + 1);
} else {
List list = new ArrayList ();. add (i + 1);. put (key, list);
}
} (Map.Entry , List > entry: reachabilityBySCC.entrySet ()) {(entry.getKey (). equals (entry.getValue ())) {. add (entry.getKey ());
}
} = new PrintWriter (new File ("output.txt"));
pw.println ("Початкова матриця суміжності:");
Matrix.printMatrix (adjacencyMatrix, topCount, pw);. println ("Матріцадостіжімості:");. printMatrix (reachabilityMatrix, topCount, pw); (List stock: stocks) { (stock.size ()> 1) {= false;
break;
}
} (isOne) {. println ("Мінімальний перевіряючий тест:");