Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
2.0 kB
3
Indexable
Never
import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

public class universityzoning {
  public static void main(String[] args) throws FileNotFoundException {
    Scanner scanner = new Scanner(new File("input.txt"));

    // public static void main(String[] args) {
    // Scanner scanner = new Scanner(System.in);


    /*
     * 1. I need to know how many students are in the right faculty
     * 2. Compare with G (if it says it needs 2 faculty to meet the threshold, then it should meet that)
     * 3. If lacking students, find the faculty that is lacking and then find the nearest 
     * student possible that is not inside the zone
     * 3.1 If there are other faculty that can also meet the requirement, you need to compare which one is nearer and which one would accomplish it faster
     * ---> example if A needs 1 students and only 10 walks, but B needs 2 students and each only needs 2 walks, means it would be fater with B
     */


    // G = faculties with their compliance target met
    // --> met when there's at least T students in their assigned cells
    int row = scanner.nextInt(), col = scanner.nextInt(), F = scanner.nextInt(), S = scanner.nextInt(),
        G = scanner.nextInt();

    for (int i = 0; i < F; i++) {
      int facultyNumCells = scanner.nextInt();
      for (int j = 0; j < facultyNumCells; j++) {
        int currRow = scanner.nextInt() - 1, currCol = scanner.nextInt() - 1; // location of the faculty zone
      }
    }

    for (int i = 0; i < S; i++) {
      // -1 because there's no 0,0 coord but instead it starts at 1,1
      int currStudRow = scanner.nextInt() - 1, currStudCol = scanner.nextInt() - 1, //location of the students
          studId = scanner.nextInt(), studFaculty = scanner.nextInt();

    }

    for (int i = 0; i < F; i++) {
      int T = scanner.nextInt();
    }
  }
}