Language: Java

import java.io.*;
import java.util.Scanner;
 
public class Main {
    public static double btsp(int[] x, int[] y) {
        int n = x.length;

        double[][] aux = new double[n][n];
        for (int j = 1; j < n; j++) {
            aux[0][j] = aux[0][j-1] + distance(x[j-1], y[j-1], x[j], y[j]);
        }

        for (int i = 1; i < n; i++) {
            for (j = i; j < n; j++) {
                if (i == j) {
                    aux[i][j] = aux[i-1][j] + distance(x[i-1], y[i-1], x[j], y[j]);
                } else if (i == j - 1) {
                    double min = Double.POSITIVE_INFINITY;
                    for (int k = 0; i < j; k++) {
                        min = Math.min(min, aux[k][j-1] + distance(x[k], y[k], x[j-1], y[j-1]));
                    }
                    aux[i][j] = min;
                } else {
                    aux[i][j] = aux[i][j-1] +distance(x[j-1], y[j-1], x[j], y[j]);
                }
            }
        }
        return aux[n-1][n-1];
    }

    public static double distance(int x1, int y1, int x2, int y2) {
        return Math.sqrt((x1-x2)^2 + (y1-y2)^2);
    }

    public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int x[] = new int[n];
        int y[] = new int[n];

        for(int i = 0; i < n; i++) {           
            x[i] = sc.nextInt();
            y[i] = sc.nextInt();
        }

        System.out.println(btsp(x, y));
    }
}


Compiler output:
Main.java:14: error: cannot find symbol
            for (j = i; j < n; j++) {
                 ^
  symbol:   variable j
  location: class Main
Main.java:14: error: cannot find symbol
            for (j = i; j < n; j++) {
                        ^
  symbol:   variable j
  location: class Main
Main.java:14: error: cannot find symbol
            for (j = i; j < n; j++) {
                               ^
  symbol:   variable j
  location: class Main
Main.java:15: error: cannot find symbol
                if (i == j) {
                         ^
  symbol:   variable j
  location: class Main
Main.java:16: error: cannot find symbol
                    aux[i][j] = aux[i-1][j] + distance(x[i-1], y[i-1], x[j], y[j]);
                           ^
  symbol:   variable j
  location: class Main
Main.java:16: error: cannot find symbol
                    aux[i][j] = aux[i-1][j] + distance(x[i-1], y[i-1], x[j], y[j]);
                                         ^
  symbol:   variable j
  location: class Main
Main.java:16: error: cannot find symbol
                    aux[i][j] = aux[i-1][j] + distance(x[i-1], y[i-1], x[j], y[j]);
                                                                         ^
  symbol:   variable j
  location: class Main
Main.java:16: error: cannot find symbol
                    aux[i][j] = aux[i-1][j] + distance(x[i-1], y[i-1], x[j], y[j]);
                                                                               ^
  symbol:   variable j
  location: class Main
Main.java:17: error: cannot find symbol
                } else if (i == j - 1) {
                                ^
  symbol:   variable j
  location: class Main
Main.java:19: error: cannot find symbol
                    for (int k = 0; i < j; k++) {
                                        ^
  symbol:   variable j
  location: class Main
Main.java:20: error: cannot find symbol
                        min = Math.min(min, aux[k][j-1] + distance(x[k], y[k], x[j-1], y[j-1]));
                                                   ^
  symbol:   variable j
  location: class Main
Main.java:20: error: cannot find symbol
                        min = Math.min(min, aux[k][j-1] + distance(x[k], y[k], x[j-1], y[j-1]));
                                                                                 ^
  symbol:   variable j
  location: class Main
Main.java:20: error: cannot find symbol
                        min = Math.min(min, aux[k][j-1] + distance(x[k], y[k], x[j-1], y[j-1]));
                                                                                         ^
  symbol:   variable j
  location: class Main
Main.java:22: error: cannot find symbol
                    aux[i][j] = min;
                           ^
  symbol:   variable j
  location: class Main
Main.java:24: error: cannot find symbol
                    aux[i][j] = aux[i][j-1] +distance(x[j-1], y[j-1], x[j], y[j]);
                           ^
  symbol:   variable j
  location: class Main
Main.java:24: error: cannot find symbol
                    aux[i][j] = aux[i][j-1] +distance(x[j-1], y[j-1], x[j], y[j]);
                                       ^
  symbol:   variable j
  location: class Main
Main.java:24: error: cannot find symbol
                    aux[i][j] = aux[i][j-1] +distance(x[j-1], y[j-1], x[j], y[j]);
                                                        ^
  symbol:   variable j
  location: class Main
Main.java:24: error: cannot find symbol
                    aux[i][j] = aux[i][j-1] +distance(x[j-1], y[j-1], x[j], y[j]);
                                                                ^
  symbol:   variable j
  location: class Main
Main.java:24: error: cannot find symbol
                    aux[i][j] = aux[i][j-1] +distance(x[j-1], y[j-1], x[j], y[j]);
                                                                        ^
  symbol:   variable j
  location: class Main
Main.java:24: error: cannot find symbol
                    aux[i][j] = aux[i][j-1] +distance(x[j-1], y[j-1], x[j], y[j]);
                                                                              ^
  symbol:   variable j
  location: class Main
20 errors