criyle/codenet-compile-errors huggingface dataset:
Language: Java


import java.util.*;

class Main {
	static final int INF = Integer.Max_VALUE/2;
	public static final Comparator<Node> COMPARATOR = new Comp();
	
	private static class Comp implements Comparator<Node>{
		public int compare(Node x,Node y){
			if(x.d>y.d){
			return 1;
			}
			else if(x.d<y.d){
			return -1;
			}
			return 0;
		}
	}
	
	static class Node{
		int id;
		int d;
		Node(int id,int d){
			this.id = id;
			this.d = d;
		}
	}
	
	
	static class Edge{
		int to;
		int cost;
		Edge(int to,int cost){
			this.to = to;
			this.cost = cost;
		}
	}
	
	public static void main(String[] args){
		Scanner stdIn = new Scanner(System.in);
		int V = stdIn.nextInt();
		int E = stdIn.nextInt();
		int r = stdIn.nextInt();
		
		ArrayList<ArrayList<Edge>> graph = new ArrayList<ArrayList<Edge>>(); 
		for(int i=0;i<V;i++){
			graph.add(new ArrayList<Edge>());
		}
		
		for(int i=0;i<E;i++){
			int s = stdIn.nextInt();
			int t = stdIn.nextInt();
			int d = stdIn.nextInt();
			Edge edge = new Edge(t,d);
			ArrayList<Edge> list = graph.get(s);
			list.add(edge);
		}
		
		PriorityQueue<Node> queue = new PriorityQueue<Node>(10,COMPARATOR);
		int[] d = new int[V];
		Arrays.fill(d,INF);
		d[r] = 0;
		Node node = new Node(r,0); 
		queue.add(node);
		
		while(!queue.isEmpty()){
			Node x = queue.poll();
			if(d[x.id]<x.d)
				continue;
			ArrayList<Edge> list = graph.get(x.id);
			for(int i=0;i<list.size();i++){
				Edge y = list.get(i);
				if(d[x.id]+y.cost<d[y.to]){
					d[y.to] = d[x.id] + y.cost;
					Node node_ = new Node(y.to,d[y.to]);
					queue.add(node_);
				}
			}
		}
		for(int i=0;i<V;i++){
			if(d[i]==INF){
				System.out.println("INF");
			}
			else{
				System.out.println(d[i]);
			}
		}
	}
}

Compiler output:
Main.java:5: error: cannot find symbol
	static final int INF = Integer.Max_VALUE/2;
	                              ^
  symbol:   variable Max_VALUE
  location: class Integer
1 error
Language: Java

import java.io.*;
import java.util.Arrays;

class Main{

static final int INF=Integer.MAX_VALUE/2;
static final PrintWriter out=new PrintWriter(System.out);


static class Edge{
int from;
int to;
int cost;
Edge(int from,int to,int cost){
this.from=from; this.to=to; this.cost=cost;
}
}

public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null&&!line.isEmpty()){
int v=Integer.parseInt(line);
int e=Integer.parseInt(br.readLine());
int r=Integer.parseInt(br.readLine());
Edge[] es=new Edge[e];
int[] d=new int[v];
for(int i=0;i<e;i++){
int s=Integer.parseInt(br.readLine());
int t=Integer.parseInt(br.readLine());
int c=Integer.parseInt(br.readLine());
es[i]=new Edge(s,t,c);
}
BellmanFord(e,r,es,d);
for(int i=0;i<v;i++){
out.println(d[i]);
}
out.flush();
}

private static void BellmanFord(int e,int r,Edge[] es,int[] d){
Arrays.fill(d,INF);
d[r]=0;
while(true){
boolean update=false;
for(int i=0;i<e;i++){
Edge e=es[i];
if(d[e.to]>d[e.from]+d[e.cost]){
d[e.to]=d[e.from]+d[e.cost];
update=true;
}
}
if(!update){
break;
}
}
}
}

Compiler output:
Main.java:41: error: illegal start of expression
private static void BellmanFord(int e,int r,Edge[] es,int[] d){
^
1 error
Language: Java

import java.io.*;
import java.util.Arrays;

class Main{

static final int INF=Integer.MAX_VALUE/2;
static final PrintWriter out=new PrintWriter(System.out);


static class Edge{
int from;
int to;
int cost;
Edge(int from,int to,int cost){
this.from=from; this.to=to; this.cost=cost;
}
}

public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null&&!line.isEmpty()){
int v=Integer.parseInt(line);
int e=Integer.parseInt(br.readLine());
int r=Integer.parseInt(br.readLine());
Edge[] es=new Edge[e];
int[] d=new int[v];
for(int i=0;i<e;i++){
int s=Integer.parseInt(br.readLine());
int t=Integer.parseInt(br.readLine());
int c=Integer.parseInt(br.readLine());
es[i]=new Edge(s,t,c);
}
BellmanFord(e,r,es,d);
for(int i=0;i<v;i++){
out.println(d[i]);
}
out.flush();
}

static void BellmanFord(int e,int r,Edge[] es,int[] d){
Arrays.fill(d,INF);
d[r]=0;
while(true){
boolean update=false;
for(int i=0;i<e;i++){
Edge e=es[i];
if(d[e.to]>d[e.from]+d[e.cost]){
d[e.to]=d[e.from]+d[e.cost];
update=true;
}
}
if(!update){
break;
}
}
}
}

Compiler output:
Main.java:41: error: illegal start of expression
static void BellmanFord(int e,int r,Edge[] es,int[] d){
^
1 error
Language: Java

import java.io.*;
import java.util.Arrays;

class Main{

static final int INF=Integer.MAX_VALUE/2;
static final PrintWriter out=new PrintWriter(System.out);


static class Edge{
int from;
int to;
int cost;
Edge(int from,int to,int cost){
this.from=from; this.to=to; this.cost=cost;
}
}

public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null&&!line.isEmpty()){
int v=Integer.parseInt(line);
int e=Integer.parseInt(br.readLine());
int r=Integer.parseInt(br.readLine());
Edge[] es=new Edge[e];
int[] d=new int[v];
for(int i=0;i<e;i++){
int s=Integer.parseInt(br.readLine());
int t=Integer.parseInt(br.readLine());
int c=Integer.parseInt(br.readLine());
es[i]=new Edge(s,t,c);
}
BellmanFord(e,r,es,d);
for(int i=0;i<v;i++){
out.println(d[i]);
}
out.flush();
}

private static void BellmanFord(int e,int r,Edge[] es,int[] d){
Arrays.fill(d,INF);
d[r]=0;
while(true){
boolean update=false;
for(int i=0;i<e;i++){
Edge e=es[i];
if(d[e.to]>d[e.from]+d[e.cost]){
d[e.to]=d[e.from]+d[e.cost];
update=true;
}
}
if(!update){
break;
}
}
}

Compiler output:
Main.java:41: error: illegal start of expression
private static void BellmanFord(int e,int r,Edge[] es,int[] d){
^
Main.java:57: error: reached end of file while parsing
}
 ^
2 errors
Language: Java

import java.io.*;
import java.util.Arrays;

class Main{

static final int INF=Integer.MAX_VALUE/2;
static final PrintWriter out=new PrintWriter(System.out);


static class Edge{
int from;
int to;
int cost;
Edge(int from,int to,int cost){
this.from=from; this.to=to; this.cost=cost;
}
}

public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null&&!line.isEmpty()){
int v=Integer.parseInt(line);
int e=Integer.parseInt(br.readLine());
int r=Integer.parseInt(br.readLine());
Edge[] es=new Edge[e];
int[] d=new int[v];
for(int i=0;i<e;i++){
int s=Integer.parseInt(br.readLine());
int t=Integer.parseInt(br.readLine());
int c=Integer.parseInt(br.readLine());
es[i]=new Edge(s,t,c);
}
BellmanFord(e,r,es,d);
for(int i=0;i<v;i++){
out.println(d[i]);
}
out.flush();
}

private static void BellmanFord(int e,int r,Edge[] es,int[] d){
Arrays.fill(d,INF);
d[r]=0;
while(true){
boolean update=false;
for(int i=0;i<e;i++){
Edge e=es[i];
if(d[e.to]>d[e.from]+d[e.cost]){
d[e.to]=d[e.from]+d[e.cost];
update=true;
}
}
if(!update) break;
}
}
}

Compiler output:
Main.java:41: error: illegal start of expression
private static void BellmanFord(int e,int r,Edge[] es,int[] d){
^
1 error
Language: Java

import java.io.*;
import java.util.Arrays;

class Main{

static final int INF=Integer.MAX_VALUE/2;
static final PrintWriter out=new PrintWriter(System.out);


static class Edge{
int from;
int to;
int cost;
Edge(int from,int to,int cost){
this.from=from; this.to=to; this.cost=cost;
}
}

public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null&&!line.isEmpty()){
int v=Integer.parseInt(line);
int e=Integer.parseInt(br.readLine());
int r=Integer.parseInt(br.readLine());
Edge[] es=new Edge[e];
int[] d=new int[v];
for(int i=0;i<e;i++){
int s=Integer.parseInt(br.readLine());
int t=Integer.parseInt(br.readLine());
int c=Integer.parseInt(br.readLine());
es[i]=new Edge(s,t,c);
}
BellmanFord(e,r,es,d);
for(int i=0;i<v;i++){
out.println(d[i]);
}
out.flush();
}
}

private static void BellmanFord(int e,int r,Edge[] es,int[] d){
Arrays.fill(d,INF);
d[r]=0;
while(true){
boolean update=false;
for(int i=0;i<e;i++){
Edge e=es[i];
if(d[e.to]>d[e.from]+d[e.cost]){
d[e.to]=d[e.from]+d[e.cost];
update=true;
}
}
if(!update) break;
}
}
}

Compiler output:
Main.java:48: error: variable e is already defined in method BellmanFord(int,int,Edge[],int[])
Edge e=es[i];
     ^
1 error
Language: Java

import java.io.*;
import java.util.Arrays;

class Main{

static final int INF=Integer.MAX_VALUE/2;

static class Edge{
int from;
int to;
int cost;
Edge(int from,int to,int cost){
this.from=from; this.to=to; this.cost=cost;
}
}

public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null&&!line.isEmpty()){
int v=Integer.parseInt(line);
int e=Integer.parseInt(br.readLine());
int r=Integer.parseInt(br.readLine());
Edge[] es=new Edge[e];
int[] d=new int[v];
for(int i=0;i<e;i++){
int s=Integer.parseInt(br.readLine());
int t=Integer.parseInt(br.readLine());
int c=Integer.parseInt(br.readLine());
es[i]=new Edge(s,t,c);
}
BellmanFord(e,r,es,d);
for(int i=0;i<v;i++) Systemout.println(d[i]);
}
}

private static void BellmanFord(int e,int r,Edge[] es,int[] d){
Arrays.fill(d,INF);
d[r]=0;
while(true){
boolean update=false;
for(int i=0;i<e;i++){
Edge ee=es[i];
if(d[ee.to]>d[ee.from]+d[ee.cost]){
d[ee.to]=d[ee.from]+d[ee.cost];
update=true;
}
}
if(!update) break;
}
}
}

Compiler output:
Main.java:33: error: cannot find symbol
for(int i=0;i<v;i++) Systemout.println(d[i]);
                     ^
  symbol:   variable Systemout
  location: class Main
1 error
Language: Java

import java.io.*;
import java.util.Arrays;

class Main{

static final int INF=Integer.MAX_VALUE/2;
static final PrintWriter out=new PrintWriter(System.out);

static class Edge{
int from;
int to;
int cost;
Edge(int from,int to,int cost){
this.from=from; this.to=to; this.cost=cost;
}
}

public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null&&!line.isEmpty()){
String[] values=line.split(" ")
int v=Integer.parseInt(values[0]);
int e=Integer.parseInt(values[1]);
int r=Integer.parseInt(values[2]);
Edge[] es=new Edge[e];
int[] d=new int[v];
for(int i=0;i<e;i++){
String[] values=br.readLine().split(" ");
int s=Integer.parseInt(values[0]);
int t=Integer.parseInt(values[1]);
int c=Integer.parseInt(values[2]);
es[i]=new Edge(s,t,c);
}
BellmanFord(e,r,es,d);
for(int i=0;i<v;i++) out.println(d[i]);
out.flush();
}
}

private static void BellmanFord(int e,int r,Edge[] es,int[] d){
Arrays.fill(d,INF);
d[r]=0;
while(true){
boolean update=false;
for(int i=0;i<e;i++){
Edge ee=es[i];
if(d[ee.to]>d[ee.from]+d[ee.cost]){
d[ee.to]=d[ee.from]+d[ee.cost];
update=true;
}
}
if(!update) break;
}
}
}

Compiler output:
Main.java:22: error: ';' expected
String[] values=line.split(" ")
                               ^
1 error
Language: Java

import java.io.*;
import java.util.Arrays;

class Main{

static final int INF=Integer.MAX_VALUE/2;
static final PrintWriter out=new PrintWriter(System.out);

static class Edge{
int from;
int to;
int cost;
Edge(int from,int to,int cost){
this.from=from; this.to=to; this.cost=cost;
}
}

public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null&&!line.isEmpty()){
String[] values=line.split(" ");
int v=Integer.parseInt(values[0]);
int e=Integer.parseInt(values[1]);
int r=Integer.parseInt(values[2]);
Edge[] es=new Edge[e];
int[] d=new int[v];
for(int i=0;i<e;i++){
String[] values=br.readLine().split(" ");
int s=Integer.parseInt(values[0]);
int t=Integer.parseInt(values[1]);
int c=Integer.parseInt(values[2]);
es[i]=new Edge(s,t,c);
}
BellmanFord(e,r,es,d);
for(int i=0;i<v;i++) out.println(d[i]);
out.flush();
}
}

private static void BellmanFord(int e,int r,Edge[] es,int[] d){
Arrays.fill(d,INF);
d[r]=0;
while(true){
boolean update=false;
for(int i=0;i<e;i++){
Edge ee=es[i];
if(d[ee.to]>d[ee.from]+d[ee.cost]){
d[ee.to]=d[ee.from]+d[ee.cost];
update=true;
}
}
if(!update) break;
}
}
}

Compiler output:
Main.java:29: error: variable values is already defined in method main(String[])
String[] values=br.readLine().split(" ");
         ^
1 error
Language: Java

import java.io.*;
import java.util.Arrays;

class Main{

static final int INF=Integer.MAX_VALUE/2;
static final PrintWriter out=new PrintWriter(System.out);

static class Edge{
int from;
int to;
int cost;
Edge(int from,int to,int cost){
this.from=from; this.to=to; this.cost=cost;
}
}

public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null&&!line.isEmpty()){
String[] values1=line.split(" ");
int v=Integer.parseInt(values[0]);
int e=Integer.parseInt(values[1]);
int r=Integer.parseInt(values[2]);
Edge[] es=new Edge[e];
int[] d=new int[v];
for(int i=0;i<e;i++){
String[] values2=br.readLine().split(" ");
int s=Integer.parseInt(values[0]);
int t=Integer.parseInt(values[1]);
int c=Integer.parseInt(values[2]);
es[i]=new Edge(s,t,c);
}
BellmanFord(e,r,es,d);
for(int i=0;i<v;i++) out.println(d[i]);
out.flush();
}
}

private static void BellmanFord(int e,int r,Edge[] es,int[] d){
Arrays.fill(d,INF);
d[r]=0;
while(true){
boolean update=false;
for(int i=0;i<e;i++){
Edge ee=es[i];
if(d[ee.to]>d[ee.from]+d[ee.cost]){
d[ee.to]=d[ee.from]+d[ee.cost];
update=true;
}
}
if(!update) break;
}
}
}

Compiler output:
Main.java:23: error: cannot find symbol
int v=Integer.parseInt(values[0]);
                       ^
  symbol:   variable values
  location: class Main
Main.java:24: error: cannot find symbol
int e=Integer.parseInt(values[1]);
                       ^
  symbol:   variable values
  location: class Main
Main.java:25: error: cannot find symbol
int r=Integer.parseInt(values[2]);
                       ^
  symbol:   variable values
  location: class Main
Main.java:30: error: cannot find symbol
int s=Integer.parseInt(values[0]);
                       ^
  symbol:   variable values
  location: class Main
Main.java:31: error: cannot find symbol
int t=Integer.parseInt(values[1]);
                       ^
  symbol:   variable values
  location: class Main
Main.java:32: error: cannot find symbol
int c=Integer.parseInt(values[2]);
                       ^
  symbol:   variable values
  location: class Main
6 errors
Language: Java

import java.io.*;
import java.util.Arrays;
import java.util.PriorityQueue;
import java.util.Comparator;
    
class Main{
    
static final int INF=Integer.MAX_VALUE/2;
static final PrintWriter out=new PrintWriter(System.out);
    
static class Pair{
int x;
int y;
Pair(int x,int y){
this.x=x; this.y=y;
}
}

static class Edge{
int to;
int cost;
Edge(int to,int cost){
this.to=to; this.cost=cost;
}
}

public class QueueComparator implements Comparator{
public int compare(Pair p1,Pair p2){
return (p1.x>p2.x)?1:(p1.x<p2.x)?-1:0;
}
}
    
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null&&!line.isEmpty()){
int v=Integer.parseInt(line.split(" ")[0]);
int e=Integer.parseInt(line.split(" ")[1]);
int r=Integer.parseInt(line.split(" ")[2]);
HashMap<Integer,ArrayList<Edge>> dic=new HashMap<Integer,ArrayList<Edge>>();
int[] d=new int[v];
for(int i=0;i<e;i++){
line=br.readLine();
int s=Integer.parseInt(line.split(" ")[0]);
int t=Integer.parseInt(line.split(" ")[1]);
int c=Integer.parseInt(line.split(" ")[2]);
if(!containsKey(s)){
ArrayList<Edge> array=new ArrayList<Edge>();
array.add(new Edge(t,c));
dic.put(s,array);
}
else{
dic.put(s,dic.get(s).add(new Edge(t,c));
}
}
djkstra(r,d,dic);
for(int i=0;i<v;i++) out.println((d[i]==INF)?"INF":d[i]);
}
}

private static void djkstra(int r,int[] d,HashMap<Integer,ArrayList<Edge>> dic){
PriorityQueue<Pair> pque=new PriorityQueue<Pair>(1,QueueComparator);
Arrays.fill(d,INF);
d[r]=0;
pque.offer(new Pair(0,r));
while(!pque.isEmpty()){
Pair p=pque.poll();
int v=p.y;
if(d[v]<p.x) continue;
for(int i=0;i<dic.get(v).size();i++){
Edge e=dic.get(v).get(i);
if(d[e.to]>d[v]+e.cost){
d[e.to]=d[v]+e.cost;
pque.offer(new Pair(d[e.to],e.to]);
}
}
}
}
}

Compiler output:
Main.java:53: error: ')' or ',' expected
dic.put(s,dic.get(s).add(new Edge(t,c));
                                       ^
Main.java:74: error: ')' or ',' expected
pque.offer(new Pair(d[e.to],e.to]);
                                ^
2 errors
Language: Java

import java.io.*;
import java.util.Arrays;
import java.util.HashMap;
import java.util.ArrayList;
import java.util.PriorityQueue;
import java.util.Comparator;
    
class Main{
    
static final int INF=Integer.MAX_VALUE/2;
static final PrintWriter out=new PrintWriter(System.out);
    
static class Pair{
int x;
int y;
Pair(int x,int y){
this.x=x; this.y=y;
}
static final Comparator<Pair> DISTANCE_ORDER=new DistanceOrderComparator();
public static class DistanceOrderComparator implements Comparator<Pair>{
public int compare(Pair p1,Pair p2){
return (p1.x>p2.x)?1:(p1.x<p2.x)?-1:0;
}
}

static class Edge{
int to;
int cost;
Edge(int to,int cost){
this.to=to; this.cost=cost;
}
}
    
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null&&!line.isEmpty()){
int v=Integer.parseInt(line.split(" ")[0]);
int e=Integer.parseInt(line.split(" ")[1]);
int r=Integer.parseInt(line.split(" ")[2]);
HashMap<Integer,ArrayList<Edge>> dic=new HashMap<Integer,ArrayList<Edge>>();
int[] d=new int[v];
for(int i=0;i<e;i++){
line=br.readLine();
int s=Integer.parseInt(line.split(" ")[0]);
int t=Integer.parseInt(line.split(" ")[1]);
int c=Integer.parseInt(line.split(" ")[2]);
if(!containsKey(s)){
ArrayList<Edge> array=new ArrayList<Edge>();
array.add(new Edge(t,c));
dic.put(s,array);
}
else{
dic.put(s,dic.get(s).add(new Edge(t,c)));
}
}
djkstra(r,d,dic);
for(int i=0;i<v;i++) out.println((d[i]==INF)?"INF":d[i]);
}
}

private static void djkstra(int r,int[] d,HashMap<Integer,ArrayList<Edge>> dic){
PriorityQueue<Pair> pque=new PriorityQueue<Pair>(1,Pair.DISTANCE_ORDER);
Arrays.fill(d,INF);
d[r]=0;
pque.offer(new Pair(0,r));
while(!pque.isEmpty()){
Pair p=pque.poll();
int v=p.y;
if(d[v]<p.x) continue;
for(int i=0;i<dic.get(v).size();i++){
Edge e=dic.get(v).get(i);
if(d[e.to]>d[v]+e.cost){
d[e.to]=d[v]+e.cost;
pque.offer(new Pair(d[e.to],e.to));
}
}
}
}
}

Compiler output:
Main.java:80: error: reached end of file while parsing
}
 ^
1 error
Language: Java

import java.io.*;
import java.util.Arrays;
import java.util.HashMap;
import java.util.ArrayList;
import java.util.PriorityQueue;
import java.util.Comparator;
    
class Main{
    
static final int INF=Integer.MAX_VALUE/2;
static final PrintWriter out=new PrintWriter(System.out);
    
static class Pair{
int x;
int y;
Pair(int x,int y){
this.x=x; this.y=y;
}
static final Comparator<Pair> DISTANCE_ORDER=new DistanceOrderComparator();
public static class DistanceOrderComparator implements Comparator<Pair>{
public int compare(Pair p1,Pair p2){
return (p1.x>p2.x)?1:(p1.x<p2.x)?-1:0;
}
}
}

static class Edge{
int to;
int cost;
Edge(int to,int cost){
this.to=to; this.cost=cost;
}
}
    
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null&&!line.isEmpty()){
int v=Integer.parseInt(line.split(" ")[0]);
int e=Integer.parseInt(line.split(" ")[1]);
int r=Integer.parseInt(line.split(" ")[2]);
HashMap<Integer,ArrayList<Edge>> dic=new HashMap<Integer,ArrayList<Edge>>();
int[] d=new int[v];
for(int i=0;i<e;i++){
line=br.readLine();
int s=Integer.parseInt(line.split(" ")[0]);
int t=Integer.parseInt(line.split(" ")[1]);
int c=Integer.parseInt(line.split(" ")[2]);
if(!containsKey(s)){
ArrayList<Edge> array=new ArrayList<Edge>();
array.add(new Edge(t,c));
dic.put(s,array);
}
else{
dic.put(s,dic.get(s).add(new Edge(t,c)));
}
}
djkstra(r,d,dic);
for(int i=0;i<v;i++) out.println((d[i]==INF)?"INF":d[i]);
}
}

private static void djkstra(int r,int[] d,HashMap<Integer,ArrayList<Edge>> dic){
PriorityQueue<Pair> pque=new PriorityQueue<Pair>(1,Pair.DISTANCE_ORDER);
Arrays.fill(d,INF);
d[r]=0;
pque.offer(new Pair(0,r));
while(!pque.isEmpty()){
Pair p=pque.poll();
int v=p.y;
if(d[v]<p.x) continue;
for(int i=0;i<dic.get(v).size();i++){
Edge e=dic.get(v).get(i);
if(d[e.to]>d[v]+e.cost){
d[e.to]=d[v]+e.cost;
pque.offer(new Pair(d[e.to],e.to));
}
}
}
}
}

Compiler output:
Main.java:49: error: cannot find symbol
if(!containsKey(s)){
    ^
  symbol:   method containsKey(int)
  location: class Main
Main.java:55: error: incompatible types: boolean cannot be converted to ArrayList<Edge>
dic.put(s,dic.get(s).add(new Edge(t,c)));
                        ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
2 errors
Language: Java

import java.io.*;
import java.util.Arrays;
import java.util.HashMap;
import java.util.ArrayList;
import java.util.PriorityQueue;
import java.util.Comparator;
    
class Main{
    
static final int INF=Integer.MAX_VALUE/2;
static final PrintWriter out=new PrintWriter(System.out);
    
static class Pair{
int x;
int y;
Pair(int x,int y){
this.x=x; this.y=y;
}
static final Comparator<Pair> DISTANCE_ORDER=new DistanceOrderComparator();
public static class DistanceOrderComparator implements Comparator<Pair>{
public int compare(Pair p1,Pair p2){
return (p1.x>p2.x)?1:(p1.x<p2.x)?-1:0;
}
}
}

static class Edge{
int to;
int cost;
Edge(int to,int cost){
this.to=to; this.cost=cost;
}
}
    
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null&&!line.isEmpty()){
int v=Integer.parseInt(line.split(" ")[0]);
int e=Integer.parseInt(line.split(" ")[1]);
int r=Integer.parseInt(line.split(" ")[2]);
HashMap<Integer,ArrayList<Edge>> dic=new HashMap<Integer,ArrayList<Edge>>();
int[] d=new int[v];
for(int i=0;i<e;i++){
line=br.readLine();
int s=Integer.parseInt(line.split(" ")[0]);
int t=Integer.parseInt(line.split(" ")[1]);
int c=Integer.parseInt(line.split(" ")[2]);
ArrayList<Edge> array;
if(!containsKey(s)){
array=new ArrayList<Edge>();
array.add(new Edge(t,c));
dic.put(s,array);
}
else{
array=dic.get(s);
array.add(new Edge(t,c));
dic.put(s,array);
}
}
djkstra(r,d,dic);
for(int i=0;i<v;i++) out.println((d[i]==INF)?"INF":d[i]);
}
}

private static void djkstra(int r,int[] d,HashMap<Integer,ArrayList<Edge>> dic){
PriorityQueue<Pair> pque=new PriorityQueue<Pair>(1,Pair.DISTANCE_ORDER);
Arrays.fill(d,INF);
d[r]=0;
pque.offer(new Pair(0,r));
while(!pque.isEmpty()){
Pair p=pque.poll();
int v=p.y;
if(d[v]<p.x) continue;
for(int i=0;i<dic.get(v).size();i++){
Edge e=dic.get(v).get(i);
if(d[e.to]>d[v]+e.cost){
d[e.to]=d[v]+e.cost;
pque.offer(new Pair(d[e.to],e.to));
}
}
}
}
}

Compiler output:
Main.java:50: error: cannot find symbol
if(!containsKey(s)){
    ^
  symbol:   method containsKey(int)
  location: class Main
1 error
Language: Java

import java.io.*;
import java.util.Arrays;
import java.util.HashMap;
import java.util.ArrayList;
import java.util.PriorityQueue;
import java.util.Comparator;
    
class Main{
    
static final int INF=Integer.MAX_VALUE/2;
static final PrintWriter out=new PrintWriter(System.out);
    
static class Pair{
int x;
int y;
Pair(int x,int y){
this.x=x; this.y=y;
}
static final Comparator<Pair> DISTANCE_ORDER=new DistanceOrderComparator();
public static class DistanceOrderComparator implements Comparator<Pair>{
public int compare(Pair p1,Pair p2){
return (p1.x>p2.x)?-1:(p1.x<p2.x)?1:0;
}
}
}

static class Edge{
int to;
int cost;
Edge(int to,int cost){
this.to=to; this.cost=cost;
}
}
    
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null&&!line.isEmpty()){
int v=Integer.parseInt(line.split(" ")[0]);
int e=Integer.parseInt(line.split(" ")[1]);
int r=Integer.parseInt(line.split(" ")[2]);
HashMap<Integer,ArrayList<Edge>> dic=new HashMap<Integer,ArrayList<Edge>>();
int[] d=new int[v];
for(int i=0;i<e;i++){
line=br.readLine();
int s=Integer.parseInt(line.split(" ")[0]);
int t=Integer.parseInt(line.split(" ")[1]);
int c=Integer.parseInt(line.split(" ")[2]);
ArrayList<Edge> array;
if(!dic.containsKey(s)){
array=new ArrayList<Edge>();
array.add(new Edge(t,c));
dic.put(s,array);
}
else{
array=dic.get(s);
array.add(new Edge(t,c));
dic.put(s,array);
}
}
djkstra(r,d,dic);
for(int i=0;i<v;i++){
out.println((d[i]==INF)?"INF":d[i]);
}
out.flush();
}
}

private static void djkstra(int r,int[] d,HashMap<Integer,ArrayList<Edge>> dic){
PriorityQueue<Pair> pque=new PriorityQueue<Pair>(1,Pair.DISTANCE_ORDER);
Arrays.fill(d,INF);
d[r]=0;
pque.offer(new Pair(0,r));
while(!pque.isEmpty()){
Pair p=pque.poll();
int v=p.y;
ArrayList<Edge> array=dic.get(v);
if(d[v]<p.x||!dic.containsKey(v)) continue;
for(int i=0;i<array.size();i++){
Edge e=array.get(i);
int to=e.to;
int dv=d[v];
int cost=e.cost
if(d[to]>dv+cost){
d[to]=dv+cost;
pque.offer(new Pair(d[to],to));
}
}
}
}
}

Compiler output:
Main.java:83: error: ';' expected
int cost=e.cost
               ^
1 error
Language: Java

import java.io.*;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.PriorityQueue;
import java.util.Comparator;
    
class Main{
    
static final int INF=Integer.MAX_VALUE/2;
static final PrintWriter out=new PrintWriter(System.out);
    
static class Pair{
int x;
int y;
Pair(int x,int y){
this.x=x; this.y=y;
}
static final Comparator<Pair> DISTANCE_ORDER=new DistanceOrderComparator();
public static class DistanceOrderComparator implements Comparator<Pair>{
public int compare(Pair p1,Pair p2){
return (p1.x>p2.x)?-1:(p1.x<p2.x)?1:0;
}
}
}

static class Edge{
int to;
int cost;
Edge(int to,int cost){
this.to=to; this.cost=cost;
}
}
    
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null&&!line.isEmpty()){
int v=Integer.parseInt(line.split(" ")[0]);
int e=Integer.parseInt(line.split(" ")[1]);
int r=Integer.parseInt(line.split(" ")[2]);
ArrayList<ArrayList<Edge>> array=new ArrayList<ArrayList<Edge>>();
int[] d=new int[v];
for(int i=0;i<v;i++) array.add(new ArrayList<Edge>());
for(int i=0;i<e;i++){
line=br.readLine();
int s=Integer.parseInt(line.split(" ")[0]);
int t=Integer.parseInt(line.split(" ")[1]);
int c=Integer.parseInt(line.split(" ")[2]);
ArrayList<Edge> list=array.get(s);
s.add(new Edge(t,c));
}
djkstra(r,d,array);
for(int i=0;i<v;i++){
out.println((d[i]==INF)?"INF":d[i]);
}
out.flush();
}
}

private static void djkstra(int r,int[] d,ArrayList<ArrayList<Edge>> array){
PriorityQueue<Pair> pque=new PriorityQueue<Pair>(1,Pair.DISTANCE_ORDER);
Arrays.fill(d,INF);
d[r]=0;
pque.offer(new Pair(0,r));
while(!pque.isEmpty()){
Pair p=pque.poll();
int v=p.y;
ArrayList<Edge> list=array.get(v);
if(d[v]<p.x||list.size()==0) continue;
for(int i=0;i<list.size();i++){
Edge e=list.get(i);
int to=e.to;
int dv=d[v];
int cost=e.cost;
if(d[to]>dv+cost){
d[to]=dv+cost;
pque.offer(new Pair(d[to],to));
}
}
}
}
}

Compiler output:
Main.java:50: error: int cannot be dereferenced
s.add(new Edge(t,c));
 ^
1 error
Language: Java

import java.io.*;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.PriorityQueue;
import java.util.Comparator;
    
class Main{
    
static final int INF=Integer.MAX_VALUE/2;
static final PrintWriter out=new PrintWriter(System.out);
    
static class Pair{
int x;
int y;
Pair(int x,int y){
this.x=x; this.y=y;
}
static final Comparator<Pair> DISTANCE_ORDER=new DistanceOrderComparator();
public static class DistanceOrderComparator implements Comparator<Pair>{
public int compare(Pair p1,Pair p2){
return (p1.x>p2.x)?-1:(p1.x<p2.x)?1:0;
}
}
}

static class Edge{
int to;
int cost;
Edge(int to,int cost){
this.to=to; this.cost=cost;
}
}

class MyArrayList extends ArrayList<Edge>{}
    
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null&&!line.isEmpty()){
int v=Integer.parseInt(line.split(" ")[0]);
int e=Integer.parseInt(line.split(" ")[1]);
int r=Integer.parseInt(line.split(" ")[2]);
MyArrayList[] array=new MyArrayList[v];
int[] d=new int[v];
for(int i=0;i<v;i++) array[i]=new MyArrayList<Edge>();
for(int i=0;i<e;i++){
line=br.readLine();
int s=Integer.parseInt(line.split(" ")[0]);
int t=Integer.parseInt(line.split(" ")[1]);
int c=Integer.parseInt(line.split(" ")[2]);
array[s].add(new Edge(t,c));
}
djkstra(r,d,array);
for(int i=0;i<v;i++){
out.println((d[i]==INF)?"INF":d[i]);
}
out.flush();
}
}

private static void djkstra(int r,int[] d,MyArrayList[] array){
PriorityQueue<Pair> pque=new PriorityQueue<Pair>(1,Pair.DISTANCE_ORDER);
Arrays.fill(d,INF);
d[r]=0;
pque.offer(new Pair(0,r));
while(!pque.isEmpty()){
Pair p=pque.poll();
int v=p.y;
ArrayList<Edge> list=array[v];
if(d[v]<p.x||list.size()==0) continue;
for(int i=0;i<list.size();i++){
Edge e=list.get(i);
int to=e.to;
int dv=d[v];
int cost=e.cost;
if(d[to]>dv+cost){
d[to]=dv+cost;
pque.offer(new Pair(d[to],to));
}
}
}
}
}

Compiler output:
Main.java:45: error: type Main.MyArrayList does not take parameters
for(int i=0;i<v;i++) array[i]=new MyArrayList<Edge>();
                                             ^
1 error
Language: Java

import java.io.*;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.PriorityQueue;
import java.util.Comparator;
    
class Main{
    
static final int INF=Integer.MAX_VALUE/2;
static final PrintWriter out=new PrintWriter(System.out);
    
static class Pair{
int x;
int y;
Pair(int x,int y){
this.x=x; this.y=y;
}
static final Comparator<Pair> DISTANCE_ORDER=new DistanceOrderComparator();
public static class DistanceOrderComparator implements Comparator<Pair>{
public int compare(Pair p1,Pair p2){
return (p1.x>p2.x)?-1:(p1.x<p2.x)?1:0;
}
}
}

static class Edge{
int to;
int cost;
Edge(int to,int cost){
this.to=to; this.cost=cost;
}
}

class MyArrayList extends ArrayList<Edge>{}
    
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null&&!line.isEmpty()){
int v=Integer.parseInt(line.split(" ")[0]);
int e=Integer.parseInt(line.split(" ")[1]);
int r=Integer.parseInt(line.split(" ")[2]);
MyArrayList[] array=new MyArrayList[v];
int[] d=new int[v];
for(int i=0;i<v;i++) array[i]=new MyArrayList;
for(int i=0;i<e;i++){
line=br.readLine();
int s=Integer.parseInt(line.split(" ")[0]);
int t=Integer.parseInt(line.split(" ")[1]);
int c=Integer.parseInt(line.split(" ")[2]);
array[s].add(new Edge(t,c));
}
djkstra(r,d,array);
for(int i=0;i<v;i++){
out.println((d[i]==INF)?"INF":d[i]);
}
out.flush();
}
}

private static void djkstra(int r,int[] d,MyArrayList[] array){
PriorityQueue<Pair> pque=new PriorityQueue<Pair>(1,Pair.DISTANCE_ORDER);
Arrays.fill(d,INF);
d[r]=0;
pque.offer(new Pair(0,r));
while(!pque.isEmpty()){
Pair p=pque.poll();
int v=p.y;
ArrayList<Edge> list=array[v];
if(d[v]<p.x||list.size()==0) continue;
for(int i=0;i<list.size();i++){
Edge e=list.get(i);
int to=e.to;
int dv=d[v];
int cost=e.cost;
if(d[to]>dv+cost){
d[to]=dv+cost;
pque.offer(new Pair(d[to],to));
}
}
}
}
}

Compiler output:
Main.java:45: error: '(' or '[' expected
for(int i=0;i<v;i++) array[i]=new MyArrayList;
                                             ^
1 error
Language: Java

import java.io.*;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.PriorityQueue;
import java.util.Comparator;
    
class Main{
    
static final int INF=Integer.MAX_VALUE/2;
static final PrintWriter out=new PrintWriter(System.out);
    
static class Pair{
int x;
int y;
Pair(int x,int y){
this.x=x; this.y=y;
}
static final Comparator<Pair> DISTANCE_ORDER=new DistanceOrderComparator();
public static class DistanceOrderComparator implements Comparator<Pair>{
public int compare(Pair p1,Pair p2){
return (p1.x>p2.x)?-1:(p1.x<p2.x)?1:0;
}
}
}

static class Edge{
int to;
int cost;
Edge(int to,int cost){
this.to=to; this.cost=cost;
}
}

class MyArrayList extends ArrayList<Edge>{}
    
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null&&!line.isEmpty()){
int v=Integer.parseInt(line.split(" ")[0]);
int e=Integer.parseInt(line.split(" ")[1]);
int r=Integer.parseInt(line.split(" ")[2]);
MyArrayList[] array=new MyArrayList[v];
int[] d=new int[v];
for(int i=0;i<v;i++) array[i]=new MyArrayList();
for(int i=0;i<e;i++){
line=br.readLine();
int s=Integer.parseInt(line.split(" ")[0]);
int t=Integer.parseInt(line.split(" ")[1]);
int c=Integer.parseInt(line.split(" ")[2]);
array[s].add(new Edge(t,c));
}
djkstra(r,d,array);
for(int i=0;i<v;i++){
out.println((d[i]==INF)?"INF":d[i]);
}
out.flush();
}
}

private static void djkstra(int r,int[] d,MyArrayList[] array){
PriorityQueue<Pair> pque=new PriorityQueue<Pair>(1,Pair.DISTANCE_ORDER);
Arrays.fill(d,INF);
d[r]=0;
pque.offer(new Pair(0,r));
while(!pque.isEmpty()){
Pair p=pque.poll();
int v=p.y;
ArrayList<Edge> list=array[v];
if(d[v]<p.x||list.size()==0) continue;
for(int i=0;i<list.size();i++){
Edge e=list.get(i);
int to=e.to;
int dv=d[v];
int cost=e.cost;
if(d[to]>dv+cost){
d[to]=dv+cost;
pque.offer(new Pair(d[to],to));
}
}
}
}
}

Compiler output:
Main.java:45: error: non-static variable this cannot be referenced from a static context
for(int i=0;i<v;i++) array[i]=new MyArrayList();
                              ^
1 error
Language: Java

import java.io.*;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.PriorityQueue;
import java.util.Comparator;
    
class Main{
    
static final int INF=Integer.MAX_VALUE/2;
static final PrintWriter out=new PrintWriter(System.out);
    
static class Pair{
int x;
int y;
Pair(int x,int y){
this.x=x; this.y=y;
}
static final Comparator<Pair> DISTANCE_ORDER=new DistanceOrderComparator();
public static class DistanceOrderComparator implements Comparator<Pair>{
public int compare(Pair p1,Pair p2){
return (p1.x>p2.x)?-1:(p1.x<p2.x)?1:0;
}
}
}

static class Edge{
int to;
int cost;
Edge(int to,int cost){
this.to=to; this.cost=cost;
}
}

ststic class MyArrayList extends ArrayList<Edge>{}
    
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null&&!line.isEmpty()){
int v=Integer.parseInt(line.split(" ")[0]);
int e=Integer.parseInt(line.split(" ")[1]);
int r=Integer.parseInt(line.split(" ")[2]);
MyArrayList[] array=new MyArrayList[v];
int[] d=new int[v];
for(int i=0;i<v;i++) array[i]=new MyArrayList();
for(int i=0;i<e;i++){
line=br.readLine();
int s=Integer.parseInt(line.split(" ")[0]);
int t=Integer.parseInt(line.split(" ")[1]);
int c=Integer.parseInt(line.split(" ")[2]);
array[s].add(new Edge(t,c));
}
djkstra(r,d,array);
for(int i=0;i<v;i++){
out.println((d[i]==INF)?"INF":d[i]);
}
out.flush();
}
}

private static void djkstra(int r,int[] d,MyArrayList[] array){
PriorityQueue<Pair> pque=new PriorityQueue<Pair>(1,Pair.DISTANCE_ORDER);
Arrays.fill(d,INF);
d[r]=0;
pque.offer(new Pair(0,r));
while(!pque.isEmpty()){
Pair p=pque.poll();
int v=p.y;
ArrayList<Edge> list=array[v];
if(d[v]<p.x||list.size()==0) continue;
for(int i=0;i<list.size();i++){
Edge e=list.get(i);
int to=e.to;
int dv=d[v];
int cost=e.cost;
if(d[to]>dv+cost){
d[to]=dv+cost;
pque.offer(new Pair(d[to],to));
}
}
}
}
}

Compiler output:
Main.java:34: error: <identifier> expected
ststic class MyArrayList extends ArrayList<Edge>{}
      ^
1 error
Language: Java

import java.util.*;

// djkstra ??????????????????
public class Dijkstra {

    static int dist[][];
    static final int INF = Integer.MAX_VALUE;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int vn = sc.nextInt();
        int ve = sc.nextInt();
        int s = sc.nextInt();

        List<Edge>[] edges = new List[vn];

        for (int i = 0; i < vn; i++) {
            edges[i] = new ArrayList<>();
        }

        for (int i = 0; i < ve; i++) {
            int a = sc.nextInt();
            int b = sc.nextInt();
            int f = sc.nextInt();
            edges[a].add(new Edge(a, b, f));
            // edges[b].add(new Edge(b, a, f));
        }

        int[] distance = new int[vn];
        Arrays.fill(distance, INF);
        distance[s] = 0;
        Queue<Edge> queue = new PriorityQueue<>();
        queue.add(new Edge(s, s, 0));

        while (!queue.isEmpty()) {
            Edge e1 = queue.poll();
            if (distance[e1.target] < e1.cost) {
                continue;
            }

            for (Edge e2: edges[e1.target]) {
                if (distance[e2.target] > distance[e1.target] + e2.cost) {
                    distance[e2.target] = distance[e1.target] + e2.cost;
                    queue.add(new Edge(e1.target, e2.target, distance[e2.target]));
                }
            }
        }

        for (int i = 0; i < vn; i++) {
            System.out.println(distance[i] == INF ? "INF" : distance[i]);
        }
    }

    static class Edge implements Comparable<Edge> {
        public int source;
        public int target;
        public int cost;

        public Edge(int source, int target, int cost) {
            this.source = source;
            this.target = target;
            this.cost = cost;
        }


        @Override
        public int compareTo(Edge o) {
            return this.cost - o.cost;
        }
    }
}

Compiler output:
Main.java:4: error: class Dijkstra is public, should be declared in a file named Dijkstra.java
public class Dijkstra {
       ^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

/**
 * Created by huzhejie on 2016/10/10.
 */
public class AdjacentList {
    @SuppressWarnings("unchecked")
    private static void dijkstra(Vertex source){
        source.minDistance = 0;
        PriorityQueue<Vertex> queue = new PriorityQueue<Vertex>();
        queue.add(source);
        while(!queue.isEmpty()){
            Vertex v = queue.poll();

            for(Edge edge:v.nighbors){
                int newDist = v.minDistance +edge.weight;
                if(edge.target.minDistance>newDist){
                    queue.remove(edge.target);
                    edge.target.minDistance = newDist;

                    queue.add(edge.target);
                }
            }
        }
    }

    public static void main(String args[]){
//        long startTime = System.currentTimeMillis();
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int l = 1;
        String str=null;
        try {
            str = br.readLine();
            Graph g = new Graph(Integer.parseInt(str.split(" ")[0]));
            int source  = Integer.parseInt(str.split(" ")[2]);
            int edge = Integer.parseInt(str.split(" ")[1]);
            while ((str = br.readLine()) != null&&l<=edge){
                String record[] = str.split(" ");
                g.addEdge(Integer.parseInt(record[0]),Integer.parseInt(record[1]),Integer.parseInt(record[2]));
                l++;
            }
            br.close();
            dijkstra(g.vertices.get(source));
            for(Vertex v:g.vertices.values()){
                if(v.minDistance == Integer.MAX_VALUE)
                    System.out.println("INF");
                else
                System.out.println(v.minDistance);
            }
//            System.out.println((System.currentTimeMillis()-startTime)/1000);
        }catch (IOException e){
            e.printStackTrace();
        }
    }

}
class Edge{
    public final Vertex target;
    public final int weight;
    public Edge(Vertex target,int weight){
        this.target = target;
        this.weight = weight;
    }
}
class Graph{
    Map<Integer,Vertex> vertices;
    public Graph(int vertexNumber){
        vertices = new LinkedHashMap<Integer, Vertex>();
        for(int i = 0;i<vertexNumber;i++){
            vertices.put(i,new Vertex(i));
        }
    }
    public void addEdge(int source,int target,int weight){
        Vertex v = vertices.get(source);
        Edge edge = new Edge(vertices.get(target),weight);
        v.nighbors.add(edge);
    }
}
@SuppressWarnings("unchecked")
class Vertex implements Comparable<Vertex>{
    int id;
    int minDistance = Integer.MAX_VALUE;
    ArrayList<Edge> nighbors;
    public Vertex(int id){
        this.id = id;
        this.nighbors = new ArrayList<Edge>();
    }
    public int compareTo(Vertex o) {
        return Integer.compare(minDistance,o.minDistance);
    }
}

Compiler output:
Main.java:9: error: class AdjacentList is public, should be declared in a file named AdjacentList.java
public class AdjacentList {
       ^
1 error
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.PriorityQueue;

public class Dijkstra {

    static class edge{
        int from, to, cost;
    }

    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] str = br.readLine().split(" ");
        int v = Integer.parseInt(str[0]);
        int e = Integer.parseInt(str[1]);
        int r = Integer.parseInt(str[2]);

        ArrayList[] es = new ArrayList[v];
        for(int i=0; i<v; i++) es[i] = (new ArrayList<edge>());

        for (int i=0; i<e; i++){
            str = br.readLine().split(" ");
            edge ed = new edge();
            ed.from = Integer.parseInt(str[0]);
            ed.to = Integer.parseInt(str[1]);
            ed.cost = Integer.parseInt(str[2]);
            es[ed.from].add(ed);
        }

        PriorityQueue dist = new PriorityQueue<long[]>((long[] le, long[] ri) -> (int)(le[0] - ri[0]));
        long[] vertex = new long[2];
        vertex[0] = 0;
        vertex[1] = r;
        dist.add(vertex);

        long[] len = new long[v];
        Arrays.fill(len, Long.MAX_VALUE);
        len[r] = 0;

        while(!dist.isEmpty()){
            vertex = (long[])dist.poll();

            long u = vertex[1];
            for (Object ed: es[(int)u]){
                if(len[((edge) ed).from] + ((edge) ed).cost < len[((edge) ed).to]) {
                    len[((edge) ed).to] = len[((edge) ed).from] + ((edge) ed).cost;
                    long[] p = new long[2];
                    p[0] = len[((edge) ed).to];
                    p[1] = ((edge) ed).to;
                    dist.add(p);
                }
            }
        }

        for(int i=0; i<v; i++){
            if(len[i] == Long.MAX_VALUE){
                System.out.println("INF");
            } else {
                System.out.println(len[i]);
            }
        }
    }
}

Compiler output:
Main.java:8: error: class Dijkstra is public, should be declared in a file named Dijkstra.java
public class Dijkstra {
       ^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
Language: Java

public class graph{
	public static void main(String[] args) throws Exception{
		Scanner s = new Scanner(System.in);
		int V = s.nextInt();
		int E = s.nextInt();
		int src = s.nextInt();
		
		HashMap<Integer, List<int[]>> graph = new HashMap<>(V);
		for(int i = 0; i < V; ++i){
			graph.put(i, new LinkedList<int[]>());
		}
		
		for(int i = 0; i < E; ++i){
			int x = s.nextInt();
			int y = s.nextInt();
			int weight = s.nextInt();
			
			graph.get(x).add(new int[] {y, weight});
		}
		
		int[] dist = new int[V];
		Arrays.fill(dist, Integer.MAX_VALUE);
		
		PriorityQueue<int[]> queue = new PriorityQueue<>();
		queue.offer(new int[]{src, 0});
		dist[src] = 0;
		
		while(!queue.isEmpty()){
			int[] vertex = queue.poll();
			
			for(int[] adj : graph.get(vertex[0])){
				if(dist[adj[0]] > dist[vertex[0]] + adj[1]){
					dist[adj[0]] = dist[vertex[0]] + adj[1];
					queue.offer(adj);
				}
			}
		}
		
		for(int i = 0; i < V; ++i){
			System.out.println(dist[i] == Integer.MAX_VALUE ? "INF" : dist[i]);
		}
	}
}

Compiler output:
Main.java:1: error: class graph is public, should be declared in a file named graph.java
public class graph{
       ^
Main.java:3: error: cannot find symbol
		Scanner s = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class graph
Main.java:3: error: cannot find symbol
		Scanner s = new Scanner(System.in);
		                ^
  symbol:   class Scanner
  location: class graph
Main.java:8: error: cannot find symbol
		HashMap<Integer, List<int[]>> graph = new HashMap<>(V);
		^
  symbol:   class HashMap
  location: class graph
Main.java:8: error: cannot find symbol
		HashMap<Integer, List<int[]>> graph = new HashMap<>(V);
		                 ^
  symbol:   class List
  location: class graph
Main.java:8: error: cannot find symbol
		HashMap<Integer, List<int[]>> graph = new HashMap<>(V);
		                                          ^
  symbol:   class HashMap
  location: class graph
Main.java:10: error: cannot find symbol
			graph.put(i, new LinkedList<int[]>());
			                 ^
  symbol:   class LinkedList
  location: class graph
Main.java:22: error: cannot find symbol
		Arrays.fill(dist, Integer.MAX_VALUE);
		^
  symbol:   variable Arrays
  location: class graph
Main.java:24: error: cannot find symbol
		PriorityQueue<int[]> queue = new PriorityQueue<>();
		^
  symbol:   class PriorityQueue
  location: class graph
Main.java:24: error: cannot find symbol
		PriorityQueue<int[]> queue = new PriorityQueue<>();
		                                 ^
  symbol:   class PriorityQueue
  location: class graph
10 errors
Language: Java

import java.util.*;

public class graph{
	public static void main(String[] args) throws Exception{
		Scanner s = new Scanner(System.in);
		int V = s.nextInt();
		int E = s.nextInt();
		int src = s.nextInt();
		
		HashMap<Integer, List<int[]>> graph = new HashMap<>(V);
		for(int i = 0; i < V; ++i){
			graph.put(i, new LinkedList<int[]>());
		}
		
		for(int i = 0; i < E; ++i){
			int x = s.nextInt();
			int y = s.nextInt();
			int weight = s.nextInt();
			
			graph.get(x).add(new int[] {y, weight});
		}
		
		int[] dist = new int[V];
		Arrays.fill(dist, Integer.MAX_VALUE);
		
		PriorityQueue<int[]> queue = new PriorityQueue<>();
		queue.offer(new int[]{src, 0});
		dist[src] = 0;
		
		while(!queue.isEmpty()){
			int[] vertex = queue.poll();
			
			for(int[] adj : graph.get(vertex[0])){
				if(dist[adj[0]] > dist[vertex[0]] + adj[1]){
					dist[adj[0]] = dist[vertex[0]] + adj[1];
					queue.offer(adj);
				}
			}
		}
		
		for(int i = 0; i < V; ++i){
			System.out.println(dist[i] == Integer.MAX_VALUE ? "INF" : dist[i]);
		}
	}
}

Compiler output:
Main.java:3: error: class graph is public, should be declared in a file named graph.java
public class graph{
       ^
1 error