import java.io.*; import java.util.*; import org.chocosolver.solver.Model; import org.chocosolver.solver.Solver; import org.chocosolver.solver.variables.IntVar; public class Go { static int nCourses, nPeriods, minCredits, maxCredits, minCourses, maxCourses; static String[] name; // name[i] is name of the ith course static int[] credits; // credits[i] is the credits for the ith course static ArrayList[] prereq; // j is in prereq[i] iff the jth course is a prerequisite for the ith course static Scanner sc; static void readBACP(String fname) throws IOException { sc = new Scanner(new File(fname)); sc.next(); nPeriods = sc.nextInt(); sc.next(); nCourses = sc.nextInt(); sc.next(); minCredits = sc.nextInt(); sc.next(); maxCredits = sc.nextInt(); sc.next(); minCourses = sc.nextInt(); sc.next(); maxCourses = sc.nextInt(); name = new String[nCourses]; credits = new int[nCourses]; prereq = new ArrayList[nCourses]; readCourses(); readPrerequisites(); sc.close(); } static void readCourses() throws IOException { sc.next(); // skip "courses" for (int i=0;i(); } } static int find(String s,String[] dict){ for (int i=0;i 0) bacp.solver.limitTime(timeLimit); if (trace) bacp.solver.showDecisions(); if (optimize) bacp.optimize(); else if (solve) bacp.solve(); bacp.show(); } }