Language: Java

#include<iostream>
#include<queue>
#include<vector>
#include<utility>
#include<functional>
using namespace std;

typedef pair<int, int> P;
struct Edge
{
  int cost, to, f;
  Edge(int c, int t){cost = c, to = t;}
};

int E, V, d[10000];
vector<Edge> edge[10000];
priority_queue<P, vector<P>, greater<P>> q;

int main()
{
loop:
  for(int i = 0; i < 10000; i++)
    edge[i].clear();
  for(int i = 0; i < 10000; i++)
    d[i] = 100000000;
  q = priority_queue<P, vector<P>, greater<P>>();
  cin >> V >> E;
  if(!V)
    return 0;
  for(int i = 0; i < E; i++)
  {
    int a, b, c;
    cin >> a >> b >> c;
    a--, b--;
    edge[a].push_back(Edge(c, b));
    edge[b].push_back(Edge(c, a));
    edge[a + V].push_back(Edge(c, b + V));
    edge[b + V].push_back(Edge(c, a + V));
  }
  for(int i = 0; i < V; i++)
    for(const auto& v1 : edge[i])
      for(const auto& v2 : edge[v1.to])
        if(v2.to != i)
          edge[i].push_back(Edge(0, v2.to + V));

  q.push(make_pair(0, 0));
  d[0] = 0;
  while(!q.empty())
  {
    auto p = q.top(); q.pop();
    int c = p.first, v = p.second;
    if(d[v] < c)
      continue;
    for(const Edge& e : edge[v])
    {
      if(d[e.to] > c + e.cost)
        q.push(make_pair(d[e.to] = c + e.cost, e.to));
    }
  }
  cout << min(d[V - 1], d[V * 2 - 1]) << endl;
  goto loop;
}

Compiler output:
Main.java:1: error: illegal character: '#'
#include<iostream>
^
Main.java:2: error: illegal character: '#'
#include<queue>
^
Main.java:3: error: illegal character: '#'
#include<vector>
^
Main.java:4: error: illegal character: '#'
#include<utility>
^
Main.java:5: error: illegal character: '#'
#include<functional>
^
Main.java:8: error: class, interface, enum, or record expected
typedef pair<int, int> P;
^
Main.java:9: error: class, interface, enum, or record expected
struct Edge
^
Main.java:12: error: class, interface, enum, or record expected
  Edge(int c, int t){cost = c, to = t;}
  ^
Main.java:12: error: class, interface, enum, or record expected
  Edge(int c, int t){cost = c, to = t;}
                                      ^
Main.java:15: error: class, interface, enum, or record expected
int E, V, d[10000];
^
Main.java:16: error: class, interface, enum, or record expected
vector<Edge> edge[10000];
^
Main.java:17: error: unnamed classes are a preview feature and are disabled by default.
priority_queue<P, vector<P>, greater<P>> q;
^
  (use --enable-preview to enable unnamed classes)
Main.java:26: error: not a statement
  q = priority_queue<P, vector<P>, greater<P>>();
                              ^
Main.java:26: error: not a statement
  q = priority_queue<P, vector<P>, greater<P>>();
                                          ^
Main.java:27: error: not a statement
  cin >> V >> E;
           ^
Main.java:33: error: not a statement
    cin >> a >> b >> c;
                  ^
Main.java:41: error: not a statement
    for(const auto& v1 : edge[i])
                  ^
Main.java:41: error: not a statement
    for(const auto& v1 : edge[i])
                             ^
Main.java:42: error: not a statement
      for(const auto& v2 : edge[v1.to])
                    ^
Main.java:42: error: not a statement
      for(const auto& v2 : edge[v1.to])
                               ^
Main.java:54: error: not a statement
    for(const Edge& e : edge[v])
                  ^
Main.java:54: error: not a statement
    for(const Edge& e : edge[v])
                            ^
Main.java:60: error: not a statement
  cout << min(d[V - 1], d[V * 2 - 1]) << endl;
                                      ^
Main.java:61: error: not a statement
  goto loop;
       ^
Main.java:26: error: ';' expected
  q = priority_queue<P, vector<P>, greater<P>>();
                      ^
Main.java:26: error: ';' expected
  q = priority_queue<P, vector<P>, greater<P>>();
                                 ^
Main.java:26: error: ';' expected
  q = priority_queue<P, vector<P>, greater<P>>();
                                             ^
Main.java:34: error: ';' expected
    a--, b--;
       ^
Main.java:41: error: illegal start of expression
    for(const auto& v1 : edge[i])
        ^
Main.java:41: error: ';' expected
    for(const auto& v1 : edge[i])
                      ^
Main.java:41: error: ';' expected
    for(const auto& v1 : edge[i])
                                ^
Main.java:42: error: illegal start of expression
      for(const auto& v2 : edge[v1.to])
          ^
Main.java:42: error: ';' expected
      for(const auto& v2 : edge[v1.to])
                        ^
Main.java:42: error: ';' expected
      for(const auto& v2 : edge[v1.to])
                                      ^
Main.java:54: error: illegal start of expression
    for(const Edge& e : edge[v])
        ^
Main.java:54: error: ';' expected
    for(const Edge& e : edge[v])
                     ^
Main.java:54: error: ';' expected
    for(const Edge& e : edge[v])
                               ^
Main.java:61: error: illegal start of expression
  goto loop;
  ^
38 errors