Hey, I wrote this code, can anyone please spot out what's wrong with this?
import java.util.*;public class wormHoles {public static void main(String args[]) {Scanner sc = new Scanner(System.in);int N = sc.nextInt();int X = sc.nextInt();int Y = sc.nextInt();int S[] = new int[N];int E[] = new int[N];int V[] = new int[X];int W[] = new int[Y];int C[] = new int[N];int D[] = new int[N];Arrays.fill(C, 0);Arrays.fill(D, 9999);for(int i=0;i<n;i++) {< pre="">S[i] = sc.nextInt();E[i] = sc.nextInt();}for(int j=0;j<x;j++) {< pre="">V[j] = sc.nextInt();}for(int k=0;k<y;k++) {< pre="">W[k]=sc.nextInt();}Arrays.sort(V);Arrays.sort(W);int diff=0,min_diff=9999,diff1=0,max_diff=9999;for(int l=0;l<n;l++) {< pre="">for(int m=0;m<x;m++) {< pre="">diff = S[l] - V[m];//System.out.println(l + ", " + m + ": " +diff);if(diff<0) {break;} else {if(diff < min_diff) {min_diff= diff;C[l] = m;//System.out.println(l + ", " + m + ": " + C[l]);}}}for(int o=Y-1;o>=0;o--) {diff1 =W[o] - E[l];//System.out.println(l + ", " + o + ": " +diff1);if(diff1<0) {break;} else {if(diff1 < max_diff) {max_diff= diff1;D[l] = o;//System.out.println(l + ", " + o + ": " + D[l]);}}}min_diff = 9999;max_diff = 9999;diff=0;diff1=0;}int sum[] = new int[N];int min_total=9999;for(int p=0;p<n;p++) {< pre="">if(D[p] > Y-1 || C[p] > X-1) {sum[p] = 9999;} else{sum[p] = W[D[p]] - V[C[p]] + 1;}if (min_total > sum[p]) {min_total = sum[p];}}System.out.println(min_total);}}
Read more… (14 words)