criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
//#define int long long
using namespace std;

struct Dice
{
	int c[6];	//??????????????????

	Dice() {}

	//c0:???, c1:??????, c2:???, c3:?\\, c4:???, c5:???
	Dice(int c0, int c1, int c2, int c3, int c4, int c5)
	{
		c[0] = c0; c[1] = c1; c[2] = c2; c[3] = c3; c[4] = c4; c[5] = c5;
	}

	void temae()
	{
		int temp = c[0];
		c[0] = c[3]; c[3] = c[5]; c[5] = c[1];
		c[1] = temp;
	}

	void oku()
	{
		int temp = c[0];
		c[0] = c[1]; c[1] = c[5]; c[5] = c[3];
		c[3] = temp;
	}

	//y????????¢??????
	void y_migi()
	{
		int temp = c[1];
		c[1] = c[4]; c[4] = c[3]; c[3] = c[2];
		c[2] = temp;
	}

	//y????????¢??????
	void y_hidari()
	{
		int temp = c[1];
		c[1] = c[2]; c[2] = c[3]; c[3] = c[4];
		c[4] = temp;
	}

	//z????????¢??????
	void z_migi()
	{
		int temp = c[0];
		c[0] = c[4]; c[4] = c[5]; c[5] = c[2];
		c[2] = temp;
	}

	//z????????¢??????
	void z_hidari()
	{
		int temp = c[0];
		c[0] = c[2]; c[2] = c[5]; c[5] = c[4];
		c[4] = temp;
	}

	//1???????????\?????????????????¢??????2????¨????????????´????????????????\\??????????????°3????\\????????????????????????
	void format()
	{
		if (c[0] == 1) {
			;
		} else if (c[1] == 1) {
			oku();
		} else if (c[2] == 1) {
			z_hidari();
		} else if (c[3] == 1) {
			temae();
		} else if (c[4] == 1) {
			z_migi();
		} else if (c[5] == 1) {
			oku();
			oku();
		}

		if (c[1] == 2)
		{
			y_migi();
			y_migi();
		} else if (c[2] == 2) {
			y_migi();
		} else if (c[4] == 2) {
			y_hidari();
		} else if (c[3] == 2) {
			return;
		} else {
			if (c[1] == 3)
			{
				y_migi();
				y_migi();
			} else if (c[2] == 3) {
				y_migi();
			} else if (c[4] == 3) {
				y_hidari();
			}
		}
	}

	bool operator == (const Dice &d) const {
		Dice td1 = Dice(c[0], c[1], c[2], c[3], c[4], c[5]);
		Dice td2 = d;

		td1.format();
		td2.format();

		rep(i,6)
		{
			if (td1.c[i] != td2.c[i]) return false;
		}
		return true;
	}
};

int n;
map<string, int> c2n;
string color[6];
int cc[6];
Dice d[30];
bool used[30];

signed main()
{
	c2n["Red"] = 1;
	c2n["Yellow"] = 2;
	c2n["Blue"] = 3;
	c2n["Magenta"] = 4;
	c2n["Green"] = 5;
	c2n["Cyan"] = 6;

	while (true)
	{
		cin >> n;
		if (n == 0) break;

		rep(j,n)
		{
			rep(i,6) cin >> color[i];
			cc[0] = c2n[color[0]];
			cc[1] = c2n[color[1]];
			cc[2] = c2n[color[2]];
			cc[3] = c2n[color[4]];
			cc[4] = c2n[color[3]];
			cc[5] = c2n[color[5]];
			d[j] = Dice(cc[0], cc[1], cc[2], cc[3], cc[4], cc[5]);
		}

		rep(i,n) used[i] = false;

		int ans = 0;
		for (int i=0; i<n; i++)
		{
			for (int j=i+1; j<n; j++)
			{
				if (d[i] == d[j] && used[j] = false;)
				{
					ans++;
					used[j] = true;
				}
			}
		}

		cout << ans << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:160:50: error: lvalue required as left operand of assignment
  160 |                                 if (d[i] == d[j] && used[j] = false;)
      |                                     ~~~~~~~~~~~~~^~~~~~~~~~
a.cc:160:69: error: expected primary-expression before ')' token
  160 |                                 if (d[i] == d[j] && used[j] = false;)
      |                                                                     ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
//#define int long long
using namespace std;

struct Dice
{
	int c[6];	//??????????????????

	Dice() {}

	//c0:???, c1:??????, c2:???, c3:?\\, c4:???, c5:???
	Dice(int c0, int c1, int c2, int c3, int c4, int c5)
	{
		c[0] = c0; c[1] = c1; c[2] = c2; c[3] = c3; c[4] = c4; c[5] = c5;
	}

	void temae()
	{
		int temp = c[0];
		c[0] = c[3]; c[3] = c[5]; c[5] = c[1];
		c[1] = temp;
	}

	void oku()
	{
		int temp = c[0];
		c[0] = c[1]; c[1] = c[5]; c[5] = c[3];
		c[3] = temp;
	}

	//y????????¢??????
	void y_migi()
	{
		int temp = c[1];
		c[1] = c[4]; c[4] = c[3]; c[3] = c[2];
		c[2] = temp;
	}

	//y????????¢??????
	void y_hidari()
	{
		int temp = c[1];
		c[1] = c[2]; c[2] = c[3]; c[3] = c[4];
		c[4] = temp;
	}

	//z????????¢??????
	void z_migi()
	{
		int temp = c[0];
		c[0] = c[4]; c[4] = c[5]; c[5] = c[2];
		c[2] = temp;
	}

	//z????????¢??????
	void z_hidari()
	{
		int temp = c[0];
		c[0] = c[2]; c[2] = c[5]; c[5] = c[4];
		c[4] = temp;
	}

	//1???????????\?????????????????¢??????2????¨????????????´????????????????\\??????????????°3????\\????????????????????????
	void format()
	{
		if (c[0] == 1) {
			;
		} else if (c[1] == 1) {
			oku();
		} else if (c[2] == 1) {
			z_hidari();
		} else if (c[3] == 1) {
			temae();
		} else if (c[4] == 1) {
			z_migi();
		} else if (c[5] == 1) {
			oku();
			oku();
		}

		if (c[1] == 2)
		{
			y_migi();
			y_migi();
		} else if (c[2] == 2) {
			y_migi();
		} else if (c[4] == 2) {
			y_hidari();
		} else if (c[3] == 2) {
			return;
		} else {
			if (c[1] == 3)
			{
				y_migi();
				y_migi();
			} else if (c[2] == 3) {
				y_migi();
			} else if (c[4] == 3) {
				y_hidari();
			}
		}
	}

	bool operator == (const Dice &d) const {
		Dice td1 = Dice(c[0], c[1], c[2], c[3], c[4], c[5]);
		Dice td2 = d;

		td1.format();
		td2.format();

		rep(i,6)
		{
			if (td1.c[i] != td2.c[i]) return false;
		}
		return true;
	}
};

int n;
map<string, int> c2n;
string color[6];
int cc[6];
Dice d[30];
bool used[30];

signed main()
{
	c2n["Red"] = 1;
	c2n["Yellow"] = 2;
	c2n["Blue"] = 3;
	c2n["Magenta"] = 4;
	c2n["Green"] = 5;
	c2n["Cyan"] = 6;

	while (true)
	{
		cin >> n;
		if (n == 0) break;

		rep(j,n)
		{
			rep(i,6) cin >> color[i];
			cc[0] = c2n[color[0]];
			cc[1] = c2n[color[1]];
			cc[2] = c2n[color[2]];
			cc[3] = c2n[color[4]];
			cc[4] = c2n[color[3]];
			cc[5] = c2n[color[5]];
			d[j] = Dice(cc[0], cc[1], cc[2], cc[3], cc[4], cc[5]);
		}

		rep(i,n) used[i] = false;

		int ans = 0;
		for (int i=0; i<n; i++)
		{
			for (int j=i+1; j<n; j++)
			{
				if (d[i] == d[j] && used[j] == false;)
				{
					ans++;
					used[j] = true;
				}
			}
		}

		cout << ans << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:160:70: error: expected primary-expression before ')' token
  160 |                                 if (d[i] == d[j] && used[j] == false;)
      |                                                                      ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;

enum FACE { TOP, BOTTOM, FRONT, BACK, LEFT, RIGHT };

class UnionFind
{
public:
	vector<int> data;
	UnionFind(int size):data(size, -1){}
	
	bool unionSet(int x, int y)
	{
		x = root(x); y=root(y);
		if(x != y)
		{
			if(data[y] < data[x]) swap(x, y);
			data[x] += data[y]; data[y] = x;
		}
		return x != y;
	}
	
	int root(int x)
	{
		return data[x] < 0 ? x:data[x]=root(data[x]);
	}
};

class Dice
{
public:
	Dice(string m[6])
	{
		f[TOP]=0; f[FRONT]=1; f[LEFT]=2;
		f[RIGHT]=3; f[BACK]=4; f[BOTTOM]=5;
		
		for(int i=0; i<6; i++)
			val[i]=m[i];
	}
	
	void rotated(FACE a, FACE b, FACE c, FACE d)
	{
		int tmp = f[a];
		f[a]=f[b];
		f[b]=f[c];
		f[c]=f[d];
		f[d]=tmp;
	}
	
	vector<Dice> all_rotate()
	{
		vector<Dice> t;
		for(int i=0; i<6; (i&1?rotateY():rotateX()), i++)
		for(int j=0; j<4; rotateZ(), j++)
			t.push_back(*this);
			
		return t;
	}
	
	void rotateX() { rotated(TOP, BACK, BOTTOM, FRONT); }
	void rotateY() { rotated(TOP, LEFT, BOTTOM, RIGHT); }
	void rotateZ() { rotated(FRONT, RIGHT, BACK, LEFT); }
	
	string GetVal(FACE fe) { return val[f[fe]]; }

	
	int f[6];
	string val[6];
};

bool isequal(vector<Dice>& a, vector<Dice>& b)
{
	for(int k=0; k<a.size(); k++) 
	for(int j=0; j<b.size(); j++)
	{
		bool g=true;
		for(int i=0; i<6; i++)
		{
			if(a[k].GetVal(i)!=b[j].GetVal(i))
			{
				g=false;
				break;
			}
		}
		if(g) return true;
	}
	
	return false;
}

int main()
{
	int N;
	while(cin >> N, N)
	{
		vector<Dice> d;
		for(int i=0; i<N; i++)
		{
			string s[6];
			for(int j=0; j<6; j++)
				cin >> s[j];
				
			d.push_back(s);
		}
		
		vector<vector<Dice> > face;
		for(int i=0; i<d.size(); i++)
			face.push_back(d[i].all_rotate());
		
		int ans=0;
		UnionFind uf(N);
		
		for(int i=0; i<N; i++)
		for(int j=i+1; j<N; j++)
		{
			if(i==j) continue;
			if(isequal(face[j], face[i]))
			{
				if(uf.unionSet(i,j))
					ans++;
			}
		}
		
		cout << ans << endl;
	}
}

Compiler output:
a.cc: In function 'bool isequal(std::vector<Dice>&, std::vector<Dice>&)':
a.cc:82:40: error: invalid conversion from 'int' to 'FACE' [-fpermissive]
   82 |                         if(a[k].GetVal(i)!=b[j].GetVal(i))
      |                                        ^
      |                                        |
      |                                        int
a.cc:67:28: note:   initializing argument 1 of 'std::string Dice::GetVal(FACE)'
   67 |         string GetVal(FACE fe) { return val[f[fe]]; }
      |                       ~~~~~^~
a.cc:82:56: error: invalid conversion from 'int' to 'FACE' [-fpermissive]
   82 |                         if(a[k].GetVal(i)!=b[j].GetVal(i))
      |                                                        ^
      |                                                        |
      |                                                        int
a.cc:67:28: note:   initializing argument 1 of 'std::string Dice::GetVal(FACE)'
   67 |         string GetVal(FACE fe) { return val[f[fe]]; }
      |                       ~~~~~^~
Language: C++

#include<iostream>
using namespace std;
int main(){
  int n,q;
  int i;
  con 
  int s[n];
  for(i=0;i<n;i++) printf("%d",&s[i]);
  printf("%d",&q);
  int t[q];
  for(i=0;i<q;i++) printf("%d",&t[i]);
  int count=0;
  int h[10000000];
  for(i=0;i<n;i++) h[s[i]] = 1;
  for(i=0;i<q;i++){
    if(h[t[q]]==1){
      count++;
      h[t[q]] = 0;
    }
  }
  scanf("%d\n",count);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'con' was not declared in this scope
    6 |   con
      |   ^~~
a.cc:8:33: error: 's' was not declared in this scope
    8 |   for(i=0;i<n;i++) printf("%d",&s[i]);
      |                                 ^
a.cc:14:22: error: 's' was not declared in this scope
   14 |   for(i=0;i<n;i++) h[s[i]] = 1;
      |                      ^
Language: Java

import java.util.Scanner;

public class main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n, m;
		int a[];

		while (true) {
			n = sc.nextInt();
			m = sc.nextInt();
			if ((n | m) == 0) {
				break;
			}
			a = new int[n];
			while (m-- != 0) {
				String k = sc.next();
				if (k.equals("A")) {
					for (int i = 0; i < n; i++) {
						if (a[i] == 0) {
							a[i] = 1;
							break;
						}
					}
				} else if (k.equals("B")) {
					boolean flag = false;
					for (int i = n - 1; 0 <= i; i--) {
						if (a[i] == 0 && (i - 1 < 0 || a[i - 1] != 1) && (n <= i + 1 || a[i + 1] != 1)) {
							a[i] = 2;
							flag = true;
							break;
						}
					}
					if (!flag) {
						for (int i = 0; i < n; i++) {
							if (a[i] == 0) {
								a[i] = 2;
								break;
							}
						}
					}
				} else if (k.equals("C")) {
					boolean flag = false;
					for (int i = 0; i < n; i++) {
						if (a[i] != 0) {
							if (i + 1 < n && a[i + 1] == 0) {
								a[i + 1] = 3;
								flag = true;
								break;
							} else if (0 <= i - 1 && a[i - 1] == 0) {
								a[i - 1] = 3;
								flag = true;
								break;
							}
						}
					}
					if (!flag) {
						a[n / 2] = 3;
					}
				} else if (k.equals("D")) {
					int min = 1 << 29;
					int minId = 0;
					for (int i = 0; i < n; i++) {
						if (a[i] == 0) {
							int tmp1 = 0;
							int tmp2 = 0;
							int id = i + 1;
							while (id < n && a[id] == 0) {
								tmp1++;
								id++;
							}
							id = i - 1;
							while (0 <= id && a[id] == 0) {
								tmp2++;
								id--;
							}
							if (Math.min(tmp1, tmp2) < min) {
								min = Math.min(tmp1, tmp2);
								minId = i;
							}
						}
					}
					a[minId] = 4;
				}
			}
			for (int i = 0; i < n; i++) {
				if (a[i] != 0) {
					System.out.print((char)(a[i] + 'A' - 1));
				} else {
					System.out.print("#");
				}
			}
			System.out.println();
		}
	}
}

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

import java.util.Scanner;

public class A0199 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n, m;
		int a[];

		while (true) {
			n = sc.nextInt();
			m = sc.nextInt();
			if ((n | m) == 0) {
				break;
			}
			a = new int[n];
			while (m-- != 0) {
				String k = sc.next();
				if (k.equals("A")) {
					for (int i = 0; i < n; i++) {
						if (a[i] == 0) {
							a[i] = 1;
							break;
						}
					}
				} else if (k.equals("B")) {
					boolean flag = false;
					for (int i = n - 1; 0 <= i; i--) {
						if (a[i] == 0 && (i - 1 < 0 || a[i - 1] != 1) && (n <= i + 1 || a[i + 1] != 1)) {
							a[i] = 2;
							flag = true;
							break;
						}
					}
					if (!flag) {
						for (int i = 0; i < n; i++) {
							if (a[i] == 0) {
								a[i] = 2;
								break;
							}
						}
					}
				} else if (k.equals("C")) {
					boolean flag = false;
					for (int i = 0; i < n; i++) {
						if (a[i] != 0) {
							if (i + 1 < n && a[i + 1] == 0) {
								a[i + 1] = 3;
								flag = true;
								break;
							} else if (0 <= i - 1 && a[i - 1] == 0) {
								a[i - 1] = 3;
								flag = true;
								break;
							}
						}
					}
					if (!flag) {
						a[n / 2] = 3;
					}
				} else if (k.equals("D")) {
					int max = 0;
					int minId = -1;
					for (int i = 0; i < n; i++) {
						if (a[i] == 0) {
							int tmp1 = 0;
							int tmp2 = 0;
							int id = i + 1;
							while (id < n && a[id] == 0) {
								tmp1++;
								id++;
							}
							if (id == n) {
								tmp1 = 1 << 29;
							}
							id = i - 1;
							while (0 <= id && a[id] == 0) {
								tmp2++;
								id--;
							}
							if (id == -1) {
								tmp2 = 1 << 29;
							}
							if (max < Math.min(tmp1, tmp2)) {
								max = Math.min(tmp1, tmp2);
								minId = i;
							}
						}
					}
					if (minId != -1) {
						a[minId] = 4;
					} else {
						for (int i = 0; i < n; i++) {
							if (a[i] == 0) {
								a[i] = 4;
								break;
							}
						}
					}
				}
			}
			for (int i = 0; i < n; i++) {
				if (a[i] != 0) {
					System.out.print((char)(a[i] + 'A' - 1));
				} else {
					System.out.print("#");
				}
			}
			System.out.println();
		}
	}
}

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

#include<stdio.h>
#include<string.h>
#include<stdlib.h>

int main(){
	int i,j,k,n,m,x,y;
	char s[105],t[5];
	while(1){
		scanf("%d%d",&n,&m);
		if(n==0)break;
		memset(s,0,sizeof(s));
		for(i=0;i<n;i++)s[i]='#';
		while(m--){
			scanf("%s",t);
			if(t[0]=='A'){
				for(i=0;i<n;i++)if(s[i]=='#'){s[i]='A';break;}
			}
			else if(t[0]=='B'){
				for(i=n-1;i>=0;i--){
					if(s[i]=='#'){
						if(i==0 && s[1]!='A'){s[0]='B';break;}
						else if(i==n-1 && s[i-1]!='A'){s[i]='B';break}
						else if(s[i-1]!='A' && s[i+1]!='A'){s[i]='B';break;}
					}
				}
				if(i==-1){
					for(j=0;j<n;j++)if(s[j]=='#'){s[j]='B';break;}
				}
			}
			else if(t[0]=='C'){
				for(i=1;i<n;i++)if(s[i]=='#' && s[i-1]!='#'){s[i]='C';break;}
				if(i==n)s[n/2]='C';
			}
			else{
				x=y=-1;
				for(i=0;i<n;i++){
					if(s[i]=='#'){
						j=1;
						while(1){
							if(i-j>=0 && s[i-j]!='#')break;
							if(i+j<=n && s[i+j]!='#')break;
							j++;
						}
						if(j>y)x=i,y=j;
					}
				}
				s[x]='D';
			}
			//printf("%s\n",s);
		}
		printf("%s\n",s);
	}
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:22:94: error: expected ';' before '}' token
   22 |                                                 else if(i==n-1 && s[i-1]!='A'){s[i]='B';break}
      |                                                                                              ^
      |                                                                                              ;
Language: C++

#include<iostream>
using namespace std;
#define rep(i,s,e) for ( int i = s; i <= e; i++ )
#define MAX 10000
char C[MAX+2];
int n, m;

void setLeft(char ch){
    for ( int i = 1; ; i++ ){
	if ( C[i] == '#' ) { C[i] = ch; return; }
    }
}

void setB(){
    for ( int i = n; i >= 1; i-- ){
	if ( C[i] == '#' && C[i-1] != 'A' && C[i+1] != 'A' ){
	    C[i] = 'B'; return;
	}
    }
    setLeft('B');
}

bool isEmpty(){
    rep(i,1,n) if ( C[i] != '#' ) return false;
    return true;
}

void setC(){
    if ( isEmpty() ){ C[n/2+1] = 'C'; return; }
    rep(i,1,n){
	if ( C[i] == '#' ) continue;
	if ( C[i+1] == '#' ) { C[i+1] = 'C'; return; }
	if ( C[i-1] == '#' ) { C[i-1] = 'C'; return; }
    }
}

int getDist( int p ){
    int l = 0, r = 0;
    while( C[p+l-1] == '#' ) l--;
    if ( C[p+l-1] == 'X' ) l = -1000000;
    while( C[p+r+1] == '#' ) r++;
    if ( C[p+r+1] == 'X' ) r = 1000000;
    return min( (-1)*l, r);
}
void setD(){
    if ( isEmpty() ){ C[1] = 'D'; return; }
    int d, mi, md = -1;
    rep(i,1,n){
	if ( C[i] != '#' ) continue;
	d = getDist(i);
	if ( d > md ) {
	    md = d; mi = i;
	}
    }
    C[mi] = 'D';
}

main(){
    char ch;
    while( cin >> n >> m && n && m ){
      assert( n <= 100 );
	rep(i,0,n+1) C[i] = '#';
	C[0] = C[n+1] = 'X';
	rep(i,1,m){ 
	    cin >> ch;
	    if ( ch == 'A' ) setLeft('A');
	    else if ( ch == 'B' ) setB();
	    else if ( ch == 'C' ) setC();
	    else if ( ch == 'D' ) setD();
	}
	rep(i,1,n) cout << C[i];
	cout << endl;
    }
}

Compiler output:
a.cc:58:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   58 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:61:7: error: 'assert' was not declared in this scope
   61 |       assert( n <= 100 );
      |       ^~~~~~
a.cc:2:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
    1 | #include<iostream>
  +++ |+#include <cassert>
    2 | using namespace std;
Language: C++

#include<iostream>
using namespace std;
int main(){
long n,m,i,j,d[101],e[101],k,dd;
char c,a[101];
while(cin>>n){
cin>>m;
if(n==0)break;
for(i=0;i<n;i++)a[i]='#';
for(j=0;j<m;j++){
cin>>c;
if(c=='A'){
for(i=0;i<n;i++)if(a[i]=='#'){a[i]='A';break;}
}else if(c=='B'){
for(i=n-1;i>=0;i--){
if(0<i&&a[i-1]!='A'&&i<n-1&&a[i+1]!='A'){a[i]='B';break;}
else if(0<i&&a[i-1]!='A'){a[i]='B';break;}
else if(i<n-1&&a[i+1]!='A'){a[i]='B';break;}
}
if(i<0){for(i=0;i<n;i++)if(a[i]=='#')a[i]='B';break}
}else if(c=='C'){
for(i=0;i<n;i++){
if(a[i]!='#'){
if(i<n-1&&a[i+1]=='#'){a[i+1]='C';break;}
else if(i>0&&a[i-1]=='#'){a[i-1]='C';break;}
}
}
if(i==n)a[n/2]='C';
}else if(c=='D'){
for(i=0;i<n;i++)d[i]=-1;
for(i=0;i<n;i++)if(a[i]!='#')break;
if(i==n){a[0]='D';continue;}
for(;i<n;i++)if(a[i]=='#')d[i]=d[i-1]+1;else d[i]=0;
for(i=0;i<n;i++)e[i]=-1;
for(i=n-1;i>=0;i--)if(a[i]!='#')break;
for(;i>=0;i--)if(a[i]=='#')e[i]=e[i+1]+1;else e[i]=0;
for(i=0;i<n;i++)if(d[i]<e[i])d[i]=e[i];
for(k=0;k<n;k++)cout<<" "<<d[k];cout<<endl;
dd=d[n-1];
for(i=n-1;i>=0;i--)if(dd<=d[i]){dd=d[i];k=i;}
a[k]='D';
}
}
a[n]=0;cout<<a<<endl;
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:52: error: expected ';' before '}' token
   20 | if(i<0){for(i=0;i<n;i++)if(a[i]=='#')a[i]='B';break}
      |                                                    ^
      |                                                    ;
Language: C++

#include<iostream>
using namespace std;
int main(){
long n,m,i,j,d[101],e[101],k,dd;
char c,a[101];
while(cin>>n){
cin>>m;
if(n==0)break;
for(i=0;i<n;i++)a[i]='#';
for(j=0;j<m;j++){
cin>>c;
if(c=='A'){
for(i=0;i<n;i++)if(a[i]=='#'){a[i]='A';break;}
}else if(c=='B'){
for(i=n-1;i>=0;i--){
if(0<i&&a[i-1]!='A'&&i<n-1&&a[i+1]!='A'){a[i]='B';break;}
else if(0<i&&a[i-1]!='A'){a[i]='B';break;}
else if(i<n-1&&a[i+1]!='A'){a[i]='B';break;}
}
if(i<0){for(i=0;i<n;i++)if(a[i]=='#'){a[i]='B';break}
}else if(c=='C'){
for(i=0;i<n;i++){
if(a[i]!='#'){
if(i<n-1&&a[i+1]=='#'){a[i+1]='C';break;}
else if(i>0&&a[i-1]=='#'){a[i-1]='C';break;}
}
}
if(i==n)a[n/2]='C';
}else if(c=='D'){
for(i=0;i<n;i++)d[i]=-1;
for(i=0;i<n;i++)if(a[i]!='#')break;
if(i==n){a[0]='D';continue;}
for(;i<n;i++)if(a[i]=='#')d[i]=d[i-1]+1;else d[i]=0;
for(i=0;i<n;i++)e[i]=-1;
for(i=n-1;i>=0;i--)if(a[i]!='#')break;
for(;i>=0;i--)if(a[i]=='#')e[i]=e[i+1]+1;else e[i]=0;
for(i=0;i<n;i++)if(d[i]<e[i])d[i]=e[i];
for(k=0;k<n;k++)cout<<" "<<d[k];cout<<endl;
dd=d[n-1];
for(i=n-1;i>=0;i--)if(dd<=d[i]){dd=d[i];k=i;}
a[k]='D';
}
}
a[n]=0;cout<<a<<endl;
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:53: error: expected ';' before '}' token
   20 | if(i<0){for(i=0;i<n;i++)if(a[i]=='#'){a[i]='B';break}
      |                                                     ^
      |                                                     ;
a.cc:47:2: error: expected '}' at end of input
   47 | }
      |  ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: Java

import java.util.*;
public class GameOfStones {
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		while(true) {
			int n = stdIn.nextInt();
			int m = stdIn.nextInt();
			
			if(n == 0 && m == 0) {
				break;
			}
		
		int[][] cost = new int[m+1][m+1];
		int[][] time = new int[m+1][m+1];
		
		for(int i = 0; i < m+1; i++) {
			for(int j = 0; j < m+1; j++) {
				cost[i][j] = 100000000;
				time[i][j] = 100000000;
			}
		}
		
		for(int i = 0; i < n; i++) {
			int a = stdIn.nextInt();
			int b = stdIn.nextInt();
			int costA = stdIn.nextInt();
			int timeA = stdIn.nextInt();
			
			cost[a][b] = costA;
			cost[b][a] = costA;
			
			time[a][b] = timeA;
			time[b][a] = timeA;
		}
		
		for(int i = 0; i < m+1; i++) {
			for(int j = 0; j < m+1; j++) {
				for(int k = 0; k < m+1; k++) {
					int tmp1 = cost[i][j];
					int tmp2 = cost[j][k];
					
					if(cost[i][k] > tmp1 + tmp2) {
						cost[i][k] = tmp1+tmp2;
					}
					
					tmp1 = time[i][j];
					tmp2 = time[j][k];
					
					if(time[i][k] > tmp1 + tmp2) {
						time[i][k] = tmp1+tmp2;
					}
				}
			}
		}
		
		int k = stdIn.nextInt();
		
		for(int i = 0; i < k; i++) {
			int p = stdIn.nextInt();
			int q = stdIn.nextInt();
			int r = stdIn.nextInt();
			
			if(r == 0) {
				System.out.println(cost[p][q]);
			}
			else {
				System.out.println(time[p][q]);
			}
			
		}
		
		}
		
	}
}

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


import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.PriorityQueue;
import java.util.Scanner;

import lombok.Data;

public class Main {

	public static void main(String[] args) throws IOException {
		new Main().run();
	}

	private void run() throws IOException {
		Scanner scanner = new Scanner(System.in);
		while (true) {
			n = scanner.nextInt();
			m = scanner.nextInt();
			if ((n | m) == 0)
				break;
			List<List<Pair>> cost = new ArrayList<List<Pair>>();
			List<List<Pair>> time = new ArrayList<List<Pair>>();
			for (int i = 0; i < m; i++) {
				cost.add(new ArrayList<Pair>());
				time.add(new ArrayList<Pair>());
			}
			for (int i = 0; i < n; i++) {
				int a = scanner.nextInt() - 1;
				int b = scanner.nextInt() - 1;
				int c = scanner.nextInt();
				int d = scanner.nextInt();
				cost.get(a).add(new Pair(b, c));
				cost.get(b).add(new Pair(a, c));
				time.get(a).add(new Pair(b, d));
				time.get(b).add(new Pair(a, d));
			}
			int s = scanner.nextInt();
			for (int i = 0; i < s; i++) {
				int a = scanner.nextInt() - 1;
				int b = scanner.nextInt() - 1;
				int c = scanner.nextInt();
				if (c == 0) {
					slove(a, b, cost);
				}else{
					slove(a, b, time);
				}
			}

		}

	}

	private void slove(int s, int g, List<List<Pair>> cost) {
		int[] map = new int[m];
		Arrays.fill(map, 1 << 24);
		map[0] = 0;
		PriorityQueue<Pair> pq = new PriorityQueue<Pair>();
		pq.add(new Pair(0, s));
		while (!pq.isEmpty()) {
			Pair pair = pq.poll();
			int a = pair.a;
			int b = pair.b;
			if(map[b]<a)
				continue;
			for (int i = 0; i < cost.get(b).size(); i++) {
				int v = cost.get(b).get(i).b;
				int o = cost.get(b).get(i).a;
				if (map[o] > v + a) {
					map[o] = v + a;
					pq.offer(new Pair(v + a, o));
				}
			}
		}
		System.out.println(map[g]);

	}

	int n;
	int m;

	@Data
	class Pair implements Comparable<Pair> {
		int a;
		int b;

		public Pair(int a, int b) {
			super();
			this.a = a;
			this.b = b;
		}

		@Override
		public int compareTo(Pair o) {
			return this.a - o.a;
		}

	}

}

Compiler output:
Main.java:9: error: package lombok does not exist
import lombok.Data;
             ^
Main.java:84: error: cannot find symbol
	@Data
	 ^
  symbol:   class Data
  location: class Main
2 errors
Language: Java

import java.util.*;
import java.lang.*;
import static java.lang.Math.*;  
import static java.util.Arrays.*; 
public class P0200 {
	Scanner sc;
	long[][] time;
	long[][] cost;
	int n,m;
	int INF=1<<28;
	void run() {
		sc = new Scanner(System.in);
		while (true) {
			n = sc.nextInt();
			m = sc.nextInt();
			if (n == 0 && m == 0)break;
			time = new long[m][m];
			cost = new long[m][m];
			
			for(int j=0; j<m; j++){  
					fill(cost[j], INF);  
				    fill(time[j], INF);  
				    }  
			for (int i=0;i<n;i++) {
				int s = sc.nextInt();
				int e = sc.nextInt();
				cost[s-1][e-1] = sc.nextInt();
				time[s-1][e-1] = sc.nextInt();
				cost[e-1][s-1] = cost[s-1][e-1];
				time[e-1][s-1] = time[s-1][e-1];
	 		}
			dijkstra();
			int k = sc.nextInt();
			for (int i=0;i<k;i++) {
				int p = sc.nextInt();
				int q = sc.nextInt();
				int r = sc.nextInt();
				if (p == q) System.out.println(0);
				else if(r==1) System.out.println(time[p-1][q-1]);
				else System.out.println(cost[p-1][q-1]);
			}
		}
	}
	
	void dijkstra () {
		for (int i=0;i<m;i++){
			for (int j=0;j<m;j++) {
				for (int k=0;k<m;k++) {
					cost[i][j] = Math.min(cost[i][j], cost[i][k] + cost[k][j]);
					time[i][j] = Math.min(time[i][j], time[i][k] + time[k][j]);
				}
			}
		}
	}
	
	public static void main(String[] args) {
		new P0200().run();
	}
}

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

import java.util.*;
import static java.lang.Math.*;  
import static java.util.Arrays.*; 
public class P0200 {
	Scanner sc;
	long[][] time;
	long[][] cost;
	int n,m;
	int INF=1<<28;
	void run() {
		sc = new Scanner(System.in);
		while (true) {
			n = sc.nextInt();
			m = sc.nextInt();
			if (n == 0 && m == 0)break;
			time = new long[m][m];
			cost = new long[m][m];
			
			for(int j=0; j<m; j++){  
					fill(cost[j], INF);  
					fill(time[j], INF);  
				}  
			for (int i=0;i<n;i++) {
				int s = sc.nextInt();
				int e = sc.nextInt();
				cost[s-1][e-1] = sc.nextInt();
				time[s-1][e-1] = sc.nextInt();
				cost[e-1][s-1] = cost[s-1][e-1];
				time[e-1][s-1] = time[s-1][e-1];
	 		}
			dijkstra();
			int k = sc.nextInt();
			for (int i=0;i<k;i++) {
				int p = sc.nextInt();
				int q = sc.nextInt();
				int r = sc.nextInt();
				if (p == q) System.out.println(0);
				else if(r==1) System.out.println(time[p-1][q-1]);
				else System.out.println(cost[p-1][q-1]);
			}
		}
	}
	
	void dijkstra () {
		for (int i=0;i<m;i++){
			for (int j=0;j<m;j++) {
				for (int k=0;k<m;k++) {
					cost[i][j] = Math.min(cost[i][j], cost[i][k] + cost[k][j]);
					time[i][j] = Math.min(time[i][j], time[i][k] + time[k][j]);
				}
			}
		}
	}
	
	public static void main(String[] args) {
		new P0200().run();
	}
}

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

import java.util.*;
import static java.lang.Math.*;  
import static java.util.Arrays.*; 
public class P0200 {
	Scanner sc;
	long[][] time;
	long[][] cost;
	int n,m;
	int INF=1<<28;
	void run() {
		sc = new Scanner(System.in);
		while (true) {
			n = sc.nextInt();
			m = sc.nextInt();
			if (n == 0 && m == 0)break;
			time = new long[m][m];
			cost = new long[m][m];
			
			for(int j=0; j<m; j++){  
					fill(cost[j], INF);  
					fill(time[j], INF);  
				}  
			for (int i=0;i<n;i++) {
				int s = sc.nextInt();
				int e = sc.nextInt();
				cost[s-1][e-1] = sc.nextInt();
				time[s-1][e-1] = sc.nextInt();
				cost[e-1][s-1] = cost[s-1][e-1];
				time[e-1][s-1] = time[s-1][e-1];
	 		}
			dijkstra();
			int k = sc.nextInt();
			for (int i=0;i<k;i++) {
				int p = sc.nextInt();
				int q = sc.nextInt();
				int r = sc.nextInt();
				if (p == q) System.out.println(0);
				else if(r==1) System.out.println(time[p-1][q-1]);
				else System.out.println(cost[p-1][q-1]);
			}
		}
	}
	
	void dijkstra () {
		for (int i=0;i<m;i++){
			for (int j=0;j<m;j++) {
				for (int k=0;k<m;k++) {
					cost[i][j] = min(cost[i][j], cost[i][k] + cost[k][j]);
					time[i][j] = min(time[i][j], time[i][k] + time[k][j]);
				}
			}
		}
	}
	
	public static void main(String[] args) {
		new P0200().run();
	}
}

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

import java.util.Arrays;
import java.util.Comparator;
import java.util.PriorityQueue;
import java.util.Scanner;

//Traveling Alone: One-way Ticket of Youth
public class AOJ0200 {

	public static int n;
	public static int m;

	public static int[][] cost;
	public static int[][] time;

	public static int[] dist;

	public static int dijkstra(int start, int goal, int x){
		Arrays.fill(dist, Integer.MAX_VALUE);
		dist[start] = 0;
		PriorityQueue<Integer> q = new PriorityQueue<Integer>(m, new Comparator<Integer>(){
			public int compare(Integer o1, Integer o2) {
				return dist[o1]-dist[o2];
			}
		});
		q.add(start);
		while(!q.isEmpty()){
			int u = q.poll();
			if(u==goal)return dist[goal];
			if(x==0){
				for(int i=0;i<m;i++){
					if(cost[u][i]!=Integer.MAX_VALUE && dist[u]+cost[u][i] < dist[i]){
						dist[i] = dist[u] + cost[u][i];
						q.remove(i);
						q.add(i);
					}
				}
			}
			else{
				for(int i=0;i<m;i++){
					if(time[u][i]!=Integer.MAX_VALUE && dist[u]+time[u][i] < dist[i]){
						dist[i] = dist[u] + time[u][i];
						q.remove(i);
						q.add(i);
					}
				}
			}
		}
		return -1;
	}

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(true){
			n = sc.nextInt();
			m = sc.nextInt();
			if(n==0&&m==0)break;
			cost = new int[m][m];
			time = new int[m][m];
			dist = new int[m];
			int[][] dcost = new int[m][m];
			int[][] dtime = new int[m][m];
			for(int[] a:cost)Arrays.fill(a, Integer.MAX_VALUE);
			for(int[] a:time)Arrays.fill(a, Integer.MAX_VALUE);
			for(int[] a:dcost)Arrays.fill(a, 1000000);
			for(int[] a:dtime)Arrays.fill(a, 1000000);
			for(int i=0;i<m;i++)dcost[i][i]=dtime[i][i]=0;
			while(n--!=0){
				int a = sc.nextInt()-1;
				int b = sc.nextInt()-1;
				int c = sc.nextInt();
				int t = sc.nextInt();
				//				if(cost[a][b] > c)
				cost[a][b] = cost[b][a] = c;
				dcost[a][b] = dcost[b][a] = Math.min(dcost[a][b], c);
				//				if(time[a][b] > t)
				time[a][b] = time[b][a] = t;
				dtime[a][b] = dtime[b][a] = Math.min(dtime[a][b], t);
			}
			for(int k=0;k<m;k++){
				for(int i=0;i<m;i++){
					for(int j=0;j<m;j++){
						dcost[i][j] = Math.min(dcost[i][j], dcost[i][k]+dcost[k][j]);
						dtime[i][j] = Math.min(dtime[i][j], dtime[i][k]+dtime[k][j]);
					}
				}
			}
			int k = sc.nextInt();
			while(k--!=0){
				int s = sc.nextInt()-1;
				int t = sc.nextInt()-1;
				int x = sc.nextInt();
				System.out.println(x==0?dcost[s][t]:dtime[s][t]);
//				System.out.println(dijkstra(s, t, x));
			}
		}
	}
}

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

import java.util.LinkedList;
import java.util.Scanner;

public class TravelingAlone {
	class Main {
		int from, to, cost, time;

		public Edge(int from, int to, int cost, int time) {
			// TODO 自動生成されたコンストラクター・スタブ
			this.from = from;
			this.to = to;
			this.cost = cost;
			this.time = time;
		}
	}

	int n, m;
	LinkedList<Edge> edges;

	void solve(int p, int q, int r) {
		int INF = Integer.MAX_VALUE;
		int[] d = new int[m + 1]; // 各駅への最短距離
		for (int i = 0; i < d.length; i++)
			d[i] = INF / 2;
		d[p] = 0;
		while (true) {
			boolean update = false;
			for (Edge e : edges) {
				if (d[e.from] != INF
						&& d[e.to] > d[e.from] + (r == 0 ? e.cost : e.time)) {
					d[e.to] = d[e.from] + (r == 0 ? e.cost : e.time);
					update = true;
				}
			}
			if (!update)
				break;
		}
		System.out.println(d[q]);
	}
	
	int[][] warshall_floyd(int r) {
		int INF = Integer.MAX_VALUE / 2;
		int[][] d = new int[m+1][m+1];
		for(int i=0; i < d.length; i++)
			for(int j=0; j < d[0].length; j++)
				d[i][j] = INF;
		for(Edge e : edges)
			d[e.from][e.to] = (r == 0 ? e.cost : e.time);
		
		for(int k=1; k < m+1; k++)
			for(int i=1; i < m+1; i++)
				for(int j=1; j < m+1; j++)
					d[i][j] = Math.min(d[i][j], d[i][k] + d[k][j]);
		
		return d;
	}

	void run() {
		Scanner scanner = new Scanner(System.in);
		while (true) {
			n = scanner.nextInt();
			m = scanner.nextInt();
			if (n == 0 || m == 0)
				break;
			edges = new LinkedList<Edge>();
			for (int i = 0; i < n; i++) {
				int a = scanner.nextInt();
				int b = scanner.nextInt();
				int cost = scanner.nextInt();
				int time = scanner.nextInt();
				edges.add(new Edge(a, b, cost, time));
				edges.add(new Edge(b, a, cost, time));
			}
			int k = scanner.nextInt();
			if (k == 0)
				return;
			int[][][] d = new int[2][][];
			d[0] = warshall_floyd(0);
			d[1] = warshall_floyd(1);
			for (int i = 0; i < k; i++) {
				int p = scanner.nextInt();
				int q = scanner.nextInt();
				int r = scanner.nextInt();
				System.out.println(d[r][p][q]);
			}
		}
	}

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		new Main().run();
	}

}

Compiler output:
Main.java:8: error: invalid method declaration; return type required
		public Edge(int from, int to, int cost, int time) {
		       ^
1 error
Language: Java

import java.util.*;

public class Traveling_Alone {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (true) {
			int n = sc.nextInt();
			int m = sc.nextInt();
			if ((n | m) == 0)
				break;
			int[][] costTable = new int[m][m];
			int[][] timeTable = new int[m][m];
			for (int i = 0; i < m; i++)
				for (int j = 0; j < m; j++) {
					costTable[i][j] = 0;
					timeTable[i][j] = 0;
				}
			for (int i = 0; i < n; i++) {
				int a = sc.nextInt() - 1;
				int b = sc.nextInt() - 1;
				int cost = sc.nextInt();
				int time = sc.nextInt();
				costTable[a][b] = cost;
				costTable[b][a] = cost;
				timeTable[a][b] = time;
				timeTable[b][a] = time;
			}
			int[][] mincost = new int[m][m];
			int[][] mintime = new int[m][m];
			for (int i = 0; i < m; i++) {
				for (int j = 0; j < m; j++) {
					mincost[i][j] = Integer.MAX_VALUE;
					mintime[i][j] = Integer.MAX_VALUE;
				}
				PriorityQueue<Data> costQueue = new PriorityQueue<Data>();
				PriorityQueue<Data> timeQueue = new PriorityQueue<Data>();
				costQueue.add(new Data(0, i));
				timeQueue.add(new Data(0, i));
				while (!costQueue.isEmpty()) {
					Data d = costQueue.poll();
					if (d.cost < mincost[i][d.num]) {
						mincost[i][d.num] = d.cost;
						for (int j = 0; j < m; j++)
							if (costTable[d.num][j] > 0)
								costQueue.add(new Data(d.cost
										+ costTable[d.num][j], j));
					}
				}
				while (!timeQueue.isEmpty()) {
					Data d = timeQueue.poll();
					if (d.cost < mintime[i][d.num]) {
						mintime[i][d.num] = d.cost;
						for (int j = 0; j < m; j++)
							if (timeTable[d.num][j] > 0)
								timeQueue.add(new Data(d.cost
										+ timeTable[d.num][j], j));
					}
				}
			}
			int k = sc.nextInt();
			for (int i = 0; i < k; i++) {
				int p = sc.nextInt() - 1;
				int q = sc.nextInt() - 1;
				int r = sc.nextInt();
				if (r == 0)
					System.out.println(mincost[p][q]);
				if (r == 1)
					System.out.println(mintime[p][q]);
			}
		}
		sc.close();
	}
}

class Data implements Comparable<Data> {
	int cost;
	int num;

	Data(int c, int n) {
		cost = c;
		num = n;
	}

	public int compareTo(Data o) {
		return new Integer(this.cost).compareTo(new Integer(o.cost));
	}
}

Compiler output:
Main.java:3: error: class Traveling_Alone is public, should be declared in a file named Traveling_Alone.java
public class Traveling_Alone {
       ^
Main.java:85: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
		return new Integer(this.cost).compareTo(new Integer(o.cost));
		                                        ^
Main.java:85: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
		return new Integer(this.cost).compareTo(new Integer(o.cost));
		       ^
1 error
2 warnings
Language: Java

import java.util.*;

public class Traveling_Alone {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (true) {
			int n = sc.nextInt();
			int m = sc.nextInt();
			if ((n | m) == 0)
				break;
			int[][] costTable = new int[m][m];
			int[][] timeTable = new int[m][m];
			for (int i = 0; i < m; i++)
				for (int j = 0; j < m; j++) {
					costTable[i][j] = 0;
					timeTable[i][j] = 0;
				}
			for (int i = 0; i < n; i++) {
				int a = sc.nextInt() - 1;
				int b = sc.nextInt() - 1;
				int cost = sc.nextInt();
				int time = sc.nextInt();
				costTable[a][b] = cost;
				costTable[b][a] = cost;
				timeTable[a][b] = time;
				timeTable[b][a] = time;
			}
			int[][] mincost = new int[m][m];
			int[][] mintime = new int[m][m];
			for (int i = 0; i < m; i++) {
				for (int j = 0; j < m; j++) {
					mincost[i][j] = Integer.MAX_VALUE;
					mintime[i][j] = Integer.MAX_VALUE;
				}
				PriorityQueue<Data> costQueue = new PriorityQueue<Data>();
				PriorityQueue<Data> timeQueue = new PriorityQueue<Data>();
				costQueue.add(new Data(0, i));
				timeQueue.add(new Data(0, i));
				while (!costQueue.isEmpty()) {
					Data d = costQueue.poll();
					if (d.cost < mincost[i][d.num]) {
						mincost[i][d.num] = d.cost;
						for (int j = 0; j < m; j++)
							if (costTable[d.num][j] > 0)
								costQueue.add(new Data(d.cost
										+ costTable[d.num][j], j));
					}
				}
				while (!timeQueue.isEmpty()) {
					Data d = timeQueue.poll();
					if (d.cost < mintime[i][d.num]) {
						mintime[i][d.num] = d.cost;
						for (int j = i; j < m; j++)
							if (timeTable[d.num][j] > 0)
								timeQueue.add(new Data(d.cost
										+ timeTable[d.num][j], j));
					}
				}
			}
			int k = sc.nextInt();
			for (int i = 0; i < k; i++) {
				int p = sc.nextInt() - 1;
				int q = sc.nextInt() - 1;
				int r = sc.nextInt();
				if (r == 0)
					System.out.println(mincost[p][q]);
				if (r == 1)
					System.out.println(mintime[p][q]);
			}
		}
		sc.close();
	}
}

class Data implements Comparable<Data> {
	int cost;
	int num;

	Data(int c, int n) {
		cost = c;
		num = n;
	}

	public int compareTo(Data o) {
		return new Integer(this.cost).compareTo(new Integer(o.cost));
	}
}

Compiler output:
Main.java:3: error: class Traveling_Alone is public, should be declared in a file named Traveling_Alone.java
public class Traveling_Alone {
       ^
Main.java:85: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
		return new Integer(this.cost).compareTo(new Integer(o.cost));
		                                        ^
Main.java:85: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
		return new Integer(this.cost).compareTo(new Integer(o.cost));
		       ^
1 error
2 warnings
Language: C


		for(k=0; k<m; i++){
			for(i=0; i<m; i++){
				for(j=0; j<m; j++){
					cost[i][j]=(cost[i][j]>cost[i][k]+cost[k][j])?(cost[i][k]+cost[k][j]):cost[i][j];
					cost[j][i]=cost[i][j];
					time[i][j]=(time[i][j]>time[i][k]+time[k][j])?(time[i][k]+time[k][j]):time[i][j];
					time[j][i]=time[i][j];
				}
			}
		}

Compiler output:
main.c:2:17: error: expected identifier or '(' before 'for'
    2 |                 for(k=0; k<m; i++){
      |                 ^~~
main.c:2:27: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    2 |                 for(k=0; k<m; i++){
      |                           ^
main.c:2:32: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    2 |                 for(k=0; k<m; i++){
      |                                ^~
Language: C

// ConsoleApplication3.cpp : ??????????????? ??¢????????±????????§????????¨????????? ?????????????????????????????????
//

#include "stdafx.h"
#include <stdio.h>

#define Limit 10000000

int MinCost(int, int);
int MinTime(int, int);

typedef struct {
	int time;
	int cost;
} LINE;

int n, m, times[101], costs[101];
LINE lines[101][101] = { {0}, {0} };

int main()
{  
	int a, b, cost, time, i, k, x, y, r;
	scanf("%d %d", &n, &m);
	
	for (i = 0; i < n; i++) {
		scanf("%d %d %d %d", &a, &b, &cost, &time);
		lines[a][b].cost = cost;
		lines[b][a].cost = cost;
		lines[a][b].time = time;
		lines[b][a].time = time;
	}

	scanf("%d", &k);

	for (i = 0; i < k; i++) {
		scanf("%d %d %d", &x, &y, &r);
		if (r == 0) {
			printf("%d\n", MinCost(x, y));
		} else if (r == 1){
			printf("%d\n", MinTime(x, y));
		}
	}

	scanf("%d %d", &x, &y);

    return 0;
}

int MinCost(int x, int y) {
	int i, j, k;
	for (i = 1; i <= m; i++) {
		costs[i] = Limit;
	}

	costs[x] = 0;

	for (i = 0; i < n; i++) {
		for (j = 1; j <= m; j++) {
			for (k = 1; k <= m; k++) {
				if ((lines[j][k].cost != 0) && (costs[k] + lines[j][k].cost < costs[j])) {
					costs[j] = costs[k] + lines[j][k].cost;
				}
			}
		}
	}

	return costs[y];
}

int MinTime(int x, int y) {
	int i, j, k;
	for (i = 1; i <= m; i++) {
		times[i] = Limit;
	}

	times[x] = 0;

	for (i = 0; i < n; i++) {
		for (j = 1; j <= m; j++) {
			for (k = 1; k <= m; k++) {
				if ((lines[j][k].time != 0)&&(times[k] + lines[j][k].time < times[j])) {
					times[j] = times[k] + lines[j][k].time;
				}
			}
		}
	}

	return times[y];
}

Compiler output:
main.c:4:10: fatal error: stdafx.h: No such file or directory
    4 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C

// ConsoleApplication3.cpp : ??????????????? ??¢????????±????????§????????¨????????? ?????????????????????????????????
//

#include "stdafx.h"
#include <stdio.h>

#define Limit 10000000

int MinCost(int, int);
int MinTime(int, int);

typedef struct {
	int time;
	int cost;
} LINE;

int n, m, times[101], costs[101];
LINE lines[101][101] = { {0}, {0} };

int main()
{  
	int a, b, cost, time, i, k, x, y, r;
	scanf("%d %d", &n, &m);
	
	while (1) {
		for (i = 0; i < n; i++) {
			scanf("%d %d %d %d", &a, &b, &cost, &time);
			lines[a][b].cost = cost;
			lines[b][a].cost = cost;
			lines[a][b].time = time;
			lines[b][a].time = time;
		}

		scanf("%d", &k);

		for (i = 0; i < k; i++) {
			scanf("%d %d %d", &x, &y, &r);
			if (r == 0) {
				printf("%d\n", MinCost(x, y));
			}
			else if (r == 1) {
				printf("%d\n", MinTime(x, y));
			}
		}

		scanf("%d %d", &n, &m);

		if (n == 0 && m == 0) {
			for (i = 0; i < k; i++) {
				return 0;
			}
		}
	}
}


int MinCost(int x, int y) {
	int i, j, k;
	for (i = 1; i <= m; i++) {
		costs[i] = Limit;
	}

	costs[x] = 0;

	for (i = 0; i < n; i++) {
		for (j = 1; j <= m; j++) {
			for (k = 1; k <= m; k++) {
				if ((lines[j][k].cost != 0) && (costs[k] + lines[j][k].cost < costs[j])) {
					costs[j] = costs[k] + lines[j][k].cost;
				}
			}
		}
	}

	return costs[y];
}

int MinTime(int x, int y) {
	int i, j, k;
	for (i = 1; i <= m; i++) {
		times[i] = Limit;
	}

	times[x] = 0;

	for (i = 0; i < n; i++) {
		for (j = 1; j <= m; j++) {
			for (k = 1; k <= m; k++) {
				if ((lines[j][k].time != 0)&&(times[k] + lines[j][k].time < times[j])) {
					times[j] = times[k] + lines[j][k].time;
				}
			}
		}
	}

	return times[y];
}

Compiler output:
main.c:4:10: fatal error: stdafx.h: No such file or directory
    4 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C

#include <stdio.h>

int line[100][100][2] = {0};
int m;//number of station

int minvalue(int p, int q, int r);

int main(void)
{
	int i;
	int n;//number of line
	int a;
	int b;
	int cost;
	int time;
	int k;//number of request
	int p;//station1
	int q;//station2
	int r;//cost or time


	while(1)
	{
		for(i=0;i<100;i++)
		{
			for(j=0;j<100;j++)
			{
				line[i][j][0]=0;
				line[i][j][1]=0;
			}
		}
		scanf("%d %d\n", &n, &m);
		
		if(n==0 && m==0)
		{
			return 0;
		}
		
		for(i=0;i<n;i++)
		{
			//include line
			scanf("%d %d %d %d\n", &a, &b, &cost, &time);
			line[a-1][b-1][0] = cost;
			line[b-1][a-1][0] = cost;
			line[a-1][b-1][1] = time;
			line[b-1][a-1][1] = time;
		}
	
		scanf("%d\n",&k);
		
		for(i=0;i<k;i++)
		{
			scanf ("%d %d %d\n", &p, &q, &r);
			printf("%d\n",minvalue(p-1, q-1, r));
		}
	}
	return 0;
}

int minvalue(int p, int q, int r)
{
	int min_value[100] = {0};
	int flag_station[100] = {0};
	
	int temp_min=100000;
	int min_station=0;
	int min=100000;
	int i;
	int j;

	flag_station[p] = 1;
	while(1)
	{
		temp_min=100000;
		min_station=0;
		min=100000;

		for(i = 0; i< m;i++)
		{
			if(flag_station[i] == 0)
			{

				for(j=0;j<m;j++)
				{
					if(flag_station[j] == 1)
					{
						if(line[i][j][r] != 0)
						{
							if(temp_min > min_value[j] + line[i][j][r])
							{
								temp_min = min_value[j] + line[i][j][r];
							}
						}
					}
				}
				if(min > temp_min)
				{
					min = temp_min;
					min_station = i;
				}
			}
		}
		if(min_station == q) return min;

		min_value[min_station] = min;
		flag_station[min_station] = 1;
	}
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:26:29: error: 'j' undeclared (first use in this function)
   26 |                         for(j=0;j<100;j++)
      |                             ^
main.c:26:29: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<iostream>
#include<map>
#include<queue>
using namespace std;

#define P pair<int, int>
#define MAX_M 300
#define MAX_N 100

int n, m, k, trainMap[MAX_N + 1][MAX_N + 1][2];

void resetTrainMap();
void inputTrainMap(int n);
int check(int p, int q, int r);

int main(){
    while(cin >>n >>m){
        if(n == 0 && m == 0) break;
        resetTrainMap();
        inputTrainMap(n);
        cin >>k;
        for(int i = 0; i < k; i++){
            int p, q, r;
            cin >>p >>q >>r;
            cout <<check(p, q, r) <<endl;
        }
    }
    return 0;
}

void resetTrainMap(){
    for(int i = 0; i <= MAX_N; i++){
        for(int j = 0; j <= MAX_N; j++){
            trainMap[i][j][0] = -1;
            trainMap[i][j][1] = -1;
        }
    }
}

void inputTrainMap(int n){
    for(int i = 0; i < n; i++){
        int a, b, c, t;
        cin >>a >>b >>c >>t;
        trainMap[a][b][0] = c;
        trainMap[b][a][0] = c;
        trainMap[a][b][1] = t;
        trainMap[b][a][1] = t;
    }
}

int check(int p, int q, int r){
    priority_queue< P, vector<P>, greater<P> > ansQu; //f = cost or time
    map<int, int> ansMap;
    for(int i = 1; i <= m; i++) ansMap.insert( map<int, int>::value_type(i, -1) );
    ansQu.push( make_pair(p, 0) );
    while(!ansQu.empty()){
        P nowq = ansQu.top();
        for(int i = 1; i <= m; i++){
            if(trainMap[nowq.first][i][r] != -1){
                if(nowq.second + trainMap[nowq.first][i][r] < ansMap[i] || ansMap[i] == -1){
                    ansMap[i] = nowq.second + trainMap[nowq.first][i][r];
                    ansQu.push( make_pair(i, ansMap[i]) );
                    //                    cout <<"push! i = " <<i <<", cost or time = " <<ansMap[i] <<endl;
                }
            }
        }
        ansQu.pop();
    }
    return ansMap[q];
}

Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.