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

#include <iostream>
#include <algorithm>
using namespace std;
int main(){
  int n;
  int r,k,t;
  int p;
  int s,d,b;
  int ans=0;
  int box[111][111];
  cin >> n;
  for(int i=0;i<n;i++){
    for(int j=0;j<n;j++){
      box[i][j]=INT_MAX;
    }
  }
  for(int i=0;i<n;i++){
    cin >> r >> k;
    for(int j=0;j<k;j++){
      cin >> t;
      box[r-1][t-1]=1;
    }
  }
  for(int z=0;z<n;z++){
    for(int i=0;i<n;i++){
      for(int j=0;j<n;j++){
	box[i][j]=min(box[i][j],box[i][z]+box[z][j]);
      }
    }
  }
  cin >> p;
  for(int i=0;i<p;i++){
    cin >> s >> d >> b;
    ans=box[s-1][d-1]+1;
    if(ans<=b){
      cout << box[s-1][d-1]+1 << endl;
    }else{
      cout << "NA" << endl;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: 'INT_MAX' was not declared in this scope
   14 |       box[i][j]=INT_MAX;
      |                 ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | #include <algorithm>
  +++ |+#include <climits>
    3 | using namespace std;
Language: C++

#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <queue>

using namespace std;

struct Packet{
	Packet(){
		ttl = current = 0;
	}

	void copy(Packet t){
		ttl = t.ttl;
		current = t.current;
		for(int i=0; i < 101; i++)checkTable[i] = t.checkTable[i];
	}

	Packet(int arg_ttl,int loc){
		ttl = arg_ttl;
		for(int i=0; i < 101; i++)checkTable[i] = 0;
		checkTable[loc] = 1;
		current = loc;
	}

	void set(int loc){
		checkTable[loc] = 1;
		current = loc;
	}

	int ttl,checkTable[101],current;
};

int main(){

	int n,r,k,to,table[101][101],num_of_packet,start,goal,t_limit;
	Packet tmp;

	for(int i=1; i < 101; i++){
		for(int k=1; k < 101; k++){
			table[i][k] = 0;
		}
	}

	scanf("%d",&n);

	for(int i = 0; i < n; i++){
		scanf("%d %d",&r,&k);
		for(int p=0;p < k; p++){
			scanf("%d",&to);
			table[r][to] = 1;
		}
	}

	scanf("%d",&num_of_packet);

	queue<Packet> Q;
	bool FLG;

	for(int i=0; i < num_of_packet; i++){
		scanf("%d %d %d",&start,&goal,&t_limit);

		FLG = false;

		if(t_limit <= 1){
			printf("NA\n");
			FLG = true;
		}

		if(!FLG){
			for(int d = 1; d <= n; d++){
				if(d != start && table[start][d] == 1){
					Packet p(t_limit-1,start);
					p.set(d);
					Q.push(p);
				}
			}
		}

		while(!Q.empty()){
			tmp.copy(Q.front());
			Q.pop();

			if(tmp.ttl > 0 && tmp.current == goal){
				printf("%d\n",t_limit - tmp.ttl+1);
				FLG = true;

				while(!Q.empty())Q.pop();

				memo[start][goal] = t_limit - tmp.ttl+1;

				break;
			}

			if(tmp.ttl > 1 && t_limit-tmp.ttl + 1 <= n){
				for(int m=1; m <= n; m++){
					if(m != tmp.current && tmp.checkTable[m] == 0 && table[tmp.current][m] == 1){
						Packet q;
						q.copy(tmp);
						q.ttl--;
						q.set(m);
						Q.push(q);
					}
				}
			}
			if(FLG)break;
		}

		if(!FLG){
			printf("NA\n");
		}

	}

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:90:33: error: 'memo' was not declared in this scope
   90 |                                 memo[start][goal] = t_limit - tmp.ttl+1;
      |                                 ^~~~
Language: C++

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<functional>
#include<unordered_map>
using namespace std;

vector<int>rinsetu[100]{};
unordered_map<int, int>taiou;
int main() {
	int a;
	cin >> a;
	for (int b = 0; b < a; b++) {
		int c, d; scanf("%d%d", &c, &d);
		taiou[c] = b;
		for (int e = 0; e < d; e++) {
			int f; scanf("%d", &f);
			rinsetu[b].push_back(f);
		}
	}
	int b; cin >> b;
	for (int c = 0; c < b; c++) {
		int g, h, i; scanf("%d%d%d", &g, &h, &i);
		int e[100]{};
		memset(e, -1, sizeof(e));
		queue<int>Q;
		e[taiou[g]] = 1;
		Q.push(g);
		while (Q.size()) {
			int o = Q.front(); Q.pop();
			o = taiou[o];
			if (e[o] > i)break;
			for (int p : rinsetu[o]) {
				if (e[taiou[p]] == -1) {
				 e[taiou[p]] = e[o] + 1; Q.push(p);
				}
			}
		}
		if (e[taiou[h]] == -1||e[taiou[h]]>i)puts("NA");
		else cout << e[taiou[h]] << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:17: error: 'memset' was not declared in this scope
   29 |                 memset(e, -1, sizeof(e));
      |                 ^~~~~~
a.cc:9:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    8 | #include<functional>
  +++ |+#include <cstring>
    9 | #include<unordered_map>
Language: C++

import java.util.*;

public class Main
{
    static final int inf = 99999;
    int[][] a;

    Main(){
	Scanner sc = new Scanner(System.in);
	int n, m, s, t;

	while(sc.hasNext()){
	    n = sc.nextInt();
	    a = new int[n+1][n+1];

	    for(int i = 0; i <= n; ++i)
		for(int j = i+1; j <= n; ++j)
		    a[i][j] = a[j][i] = inf;

	    for(int i = 0; i < n; ++i){
		s = sc.nextInt();
		m = sc.nextInt();
		for(int j = 0; j < m; ++j){
		    t = sc.nextInt();
		    a[s][t] = 1;
		}
	    }

	    for(int k = 1; k <= n; ++k)
		for(int i = 1; i <= n; ++i)
		    for(int j = 1; j <= n; ++j)
			a[i][j] = Math.min(a[i][j], a[i][k]+a[k][j]);

	    n = sc.nextInt();
	    for(int i = 0; i < n; ++i){
		s = sc.nextInt();
		t = sc.nextInt();
		m = sc.nextInt();
		if(a[s][t] < u)
		    System.out.println(Integer.toString(a[s][t]+1));
		else
		    System.out.println("NA");
	    }
	}
    }

    public static void main(String[] args){
	new Main();
    }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main
      | ^~~~~~
Language: C++

#include<iostream>
#include<cstdio>

using namespace std;
#define SUB 103

int net[SUB][SUB],n,maxx=0;

typedef pair<int,int> BVB;


int ans(int,int,int);



int main(){

 

  int i,j,p,num,n1,th;

  cin >> n;



  for(i=0;i<n;i++){ //net's info
    
    cin >> num >> n1;
    if(num >= maxx)maxx = num;


    for(int k=0;k<maxx;k++)net[num][k]=0;    //siyoukanou

    for(j=0;j<n1;j++){
      cin >> th;
      net[num][th]=1;
    }

  }//net's info
  // cout << "maxx =" << maxx << endl;
  for(int m=0;m<maxx;m++){
    for(int n=0;n<maxx;n++){
      if(net[m][n]!=1)net[m][n]=0;
    }
  }

  

  int pkn;

  cin >> pkn;

  int st,ed,c,answer;

  



  for(i=0;i<pkn;i++){//pack's info
    cin >> st >> ed >> c;


    answer = ans(st,ed,c);

    if(answer != -2)cout << answer << endl;
    else cout << "NA" << endl;

  }//pack's info



}



//L[(ÊÌzñÅà¢¢¯Ç)ÉÇñÇñüêÄ¢«TTLªO¢ÉÈéOÉÚInÉBÅ«é©Ç¤©ð²×é
//[^ÍÚInÉBµ½n_ÌTTL©çvZµÄ¾·
int ans(int st,int ed,int c){
  queue<BVB> Nari;
  int i,j,k,l,cal=0,mem=0;
  BVB next,fr;

  fr.first=st;
  fr.second=c;
  Nari.push(fr);
  /*
  cout << "FIRST next.second = " << c << endl;  
  cout << "FIRST cal = " << cal << endl;
  */  

  if(st == ed && c != 0)return 1;


  while(1){
    next=Nari.front();
    Nari.pop();
    next.second=next.second-1;

    if(fr.second == (next.second+1) && next.second == 0 && next.first != ed)return -2;

    if(next.second < 0)break; //I¹ð
    //cout << "next.second = " << next.second << endl; 
    
    for(i=1;i<=maxx;i++){//¢¯éêðL[Éüêé
      if(net[next.first][i] == 1)mem++;  

    
      
      if(net[next.first][i] == 1 && i == ed ){ //ÚInB
	/*	
	cout << "GOOOOOOOOOL!!! i = " << i <<endl;
	cout << "             cal = " << cal << endl;
	cout << "     next.second = " << next.second << endl; 
	*/

	return (fr.second - next.second)+1;
	
      }
      
      if(net[next.first][i] == 1)Nari.push(BVB(i,next.second));
      
      if(mem == n)break;
    }
      
    
  }

  return -2;
  
  
  
}

Compiler output:
a.cc: In function 'int ans(int, int, int)':
a.cc:79:3: error: 'queue' was not declared in this scope
   79 |   queue<BVB> Nari;
      |   ^~~~~
a.cc:3:1: note: 'std::queue' is defined in header '<queue>'; this is probably fixable by adding '#include <queue>'
    2 | #include<cstdio>
  +++ |+#include <queue>
    3 | 
a.cc:79:12: error: expected primary-expression before '>' token
   79 |   queue<BVB> Nari;
      |            ^
a.cc:79:14: error: 'Nari' was not declared in this scope
   79 |   queue<BVB> Nari;
      |              ^~~~
Language: C++

#include<iostream>
#include<queue>
#define MAX_N 110
bool A[MAX_N][MAX_N];
int rooter_num;
using namespace std;
int bfs(int,int);
int main()
{
  int n,startNode,goalNode,TTL;
  int r,k,t;
  memset(A,false,sizeof(A));
  cin>>rooter_num;
  for(int i=0;i<rooter_num;i++)
    {
      cin>>r>>k;
      for(int j=0;j<k;j++)
	{
	  cin>>t;
	  A[r][t]=true;
	}
    }
  for(int i=1;i<=rooter_num;i++)
    {
      for(int j=1;j<=rooter_num;j++)
	{
	  cout<<A[i][j];
	}
      cout<<endl;
    }
  
  cin>>n;
  for(int i=0;i<n;i++)
    {
      cin>>startNode>>goalNode>>TTL;
      int a=bfs(startNode,goalNode);
      if(a>TTL)cout<<"NA"<<endl;
      else cout<<a<<endl;
    }
}
int bfs(int startNode,int goalNode)
{
  queue<int>Q;
  int visited[rooter_num+1];
  memset(visited,false,sizeof(visited));
  int currentNode=startNode;
  
  Q.push(currentNode);
  visited[currentNode]=true;
  
  while(!Q.empty())
    {

      
      currentNode=Q.front();
      Q.pop();
      for(int nextNode=1;nextNode<=rooter_num;nextNode++)
	{

	  if(A[currentNode][nextNode]==false)continue;

	  if(nextNode==goalNode)return visited[currentNode]+1;
	  
	  if(visited[nextNode]==false)
	    {
	      visited[nextNode]=visited[currentNode]+1;
	      Q.push(nextNode);
	    }
	}
    }
  return MAX_N;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:3: error: 'memset' was not declared in this scope
   12 |   memset(A,false,sizeof(A));
      |   ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<queue>
  +++ |+#include <cstring>
    3 | #define MAX_N 110
a.cc: In function 'int bfs(int, int)':
a.cc:45:3: error: 'memset' was not declared in this scope
   45 |   memset(visited,false,sizeof(visited));
      |   ^~~~~~
a.cc:45:3: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: Java

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

public class Main{
	public static void main(String args[]){
		try{
			new Main();
		}catch(IOException e){
			e.printStackTrace();
		}
	}
	
	public Main() throws IOException{
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String line = in.readLine();
		int size = Integer.parseInt(line);
		List<Cards> data = new ArrayList<Cards>();
		for(int i=0; i<size; i++){
			line = in.readLine();
			String[] tmp = line.split(" ");
			long a = Long.parseLong(tmp[0]);
			long b = Long.parseLong(tmp[1]);
			data.add(new Cards(a, b));
		}
		
		long cost = 0;
		cost = get_cost(data, cost);
		
		System.out.println(cost);
	}
	
	public long get_cost(List<Cards> data, long cost){
		if(data.size() > 1){
			long min = Long.MAX_VALUE;
			for(int n=0; n<data.size()-1; n++){
				long c = Cards.join_cost(data.get(n), data.get(n+1));
				List<Cards> temp = new ArrayList<Cards>(data);
				temp.set(n+1, Cards.join(data.get(n), data.get(n+1)));
				temp.remove(n);
				long m = get_cost(temp, cost+c); 
				if(min > m){
					min = m;
				}
			}
			return min;
		}else{
			return cost;
		}
	}
}

Compiler output:
Main.java:32: error: cannot find symbol
	public long get_cost(List<Cards> data, long cost){
	                          ^
  symbol:   class Cards
  location: class Main
Main.java:17: error: cannot find symbol
		List<Cards> data = new ArrayList<Cards>();
		     ^
  symbol:   class Cards
  location: class Main
Main.java:17: error: cannot find symbol
		List<Cards> data = new ArrayList<Cards>();
		                                 ^
  symbol:   class Cards
  location: class Main
Main.java:23: error: cannot find symbol
			data.add(new Cards(a, b));
			             ^
  symbol:   class Cards
  location: class Main
Main.java:36: error: cannot find symbol
				long c = Cards.join_cost(data.get(n), data.get(n+1));
				         ^
  symbol:   variable Cards
  location: class Main
Main.java:37: error: cannot find symbol
				List<Cards> temp = new ArrayList<Cards>(data);
				     ^
  symbol:   class Cards
  location: class Main
Main.java:37: error: cannot find symbol
				List<Cards> temp = new ArrayList<Cards>(data);
				                                 ^
  symbol:   class Cards
  location: class Main
Main.java:38: error: cannot find symbol
				temp.set(n+1, Cards.join(data.get(n), data.get(n+1)));
				              ^
  symbol:   variable Cards
  location: class Main
8 errors
Language: Java


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

public class Main{
	public static void main(String args[]){
		try{
			new Main();
		}catch(IOException e){
			e.printStackTrace();
		}
	}
	
	public Main() throws IOException{
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String line = in.readLine();
		int size = Integer.parseInt(line);
		List<Cards> data = new ArrayList<Cards>();
		for(int i=0; i<size; i++){
			line = in.readLine();
			String[] tmp = line.split(" ");
			long a = Long.parseLong(tmp[0]);
			long b = Long.parseLong(tmp[1]);
			data.add(new Cards(a, b));
		}
		
		long cost = 0;
		cost = get_cost(data, cost);
		
		System.out.println(cost);
	}
	
	public long get_cost(List<Cards> data, long cost){
		if(data.size() > 1){
			long min = Long.MAX_VALUE;
			for(int n=0; n<data.size()-1; n++){
				long c = Cards.join_cost(data.get(n), data.get(n+1));
				List<Cards> temp = new ArrayList<Cards>(data);
				temp.set(n+1, Cards.join(data.get(n), data.get(n+1)));
				temp.remove(n);
				long m = get_cost(temp, cost+c); 
				if(min > m){
					min = m;
				}
			}
			return min;
		}else{
			return cost;
		}
	}
}

lass Cards{
	long above;
	long bottom;
	public Cards(long a, long b){
		this.above = a;
		this.bottom = b;
	}
	
	static Cards join(Cards c1, Cards c2){
		return new Cards(c1.above, c2.bottom);
	}
	
	static long join_cost(Cards c1, Cards c2){
		return c1.above * c1.bottom * c2.above * c2.bottom;
	}
}

Compiler output:
Main.java:53: error: class, interface, enum, or record expected
lass Cards{
^
Main.java:55: error: unnamed classes are a preview feature and are disabled by default.
	long bottom;
	^
  (use --enable-preview to enable unnamed classes)
Main.java:56: error: class, interface, enum, or record expected
	public Cards(long a, long b){
	       ^
Main.java:58: error: class, interface, enum, or record expected
		this.bottom = b;
		^
Main.java:59: error: class, interface, enum, or record expected
	}
	^
Main.java:63: error: class, interface, enum, or record expected
	}
	^
Main.java:67: error: class, interface, enum, or record expected
	}
	^
7 errors
Language: C++

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

int u[100], b[100];
int dp[100][100];

int main(void){
  int n;
  cin >> n;
  for(int i = 0; i < n; i++){
    cin >> u[i] >> b[i];
  }

  for(int i = 0; i < n; i++){
    for(int j = 0; j < n; j++){
      if(i != j) dp[i][j] = INT_MAX;
    }
    dp[i][i] = 0;
  }

  for(int i = 1; i <= n; i++){
    for(int j = 0; j < n - i; j++){
      for(int k = j; k < j + i; k++){
        dp[j][j+i] = min(dp[j][j+i], dp[j][k] + dp[k+1][j+i] + u[j] * b[k] * u[k+1] * b[j+i]);
      }
    }
  }

  cout << dp[0][n-1] << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:29: error: 'INT_MAX' was not declared in this scope
   17 |       if(i != j) dp[i][j] = INT_MAX;
      |                             ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | #include <algorithm>
  +++ |+#include <climits>
    3 | using namespace std;
Language: C++

#include<iostream>
#include<math.h>
#include<vector>
#include<algorithm>
#include<cstdio>
#include <string>
using namespace std;

int a[100],b[100];
int dp[100][100];
 
int main(){
    int n,i,j,k;
    cin >> n;
    for(i=0;i<n;i++) cin >> a[i] >> b[i];
    for(i=0;i<n;i++) for(j=0;j<n;j++) dp[i][j] = INT_MAX;
    for(i=0;i<n;i++) dp[i][i] = 0;
    for(i=2;i<=n;i++){
        for(j=0;j<=n-i;j++){
            for(k=j+1;k<j+i;k++){
                dp[j][j+i-1] = min(dp[j][j+i-1] , dp[j][k-1] + dp[k][j+i-1] + a[j] * b[k-1] * a[k] * b[j+i-1]);
            }
        }
    }
    cout << dp[0][n-1] << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:50: error: 'INT_MAX' was not declared in this scope
   16 |     for(i=0;i<n;i++) for(j=0;j<n;j++) dp[i][j] = INT_MAX;
      |                                                  ^~~~~~~
a.cc:6:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    5 | #include<cstdio>
  +++ |+#include <climits>
    6 | #include <string>
Language: C++

#include <iostream>
#include <vector>
#include <map>

using namespace std;

typedef pair<int, int> P;
vector<P> D;

int n, a, b;
int DP[101][101];

void solve()
{
	for(int i=0; i<n; i++)
	{
		for(int j=0; j<n; j++)
		{
			if(i!=j) DP[i][j] = INT_MAX;
			else DP[i][j] = 0;
		}
	}	

	for(int i=1; i<n; i++)
	{
		for(int j=0; j<n-i; j++)
		{
			for(int k=j; k<j+i; k++)
			{
				int cost = D[j].first * D[k].second * D[k+1].first * D[j+i].second;
				DP[j][j+i] = min(DP[j][j+i], cost + DP[j][k] + DP[k+1][j+i]);
			}
		}
	}

	cout << DP[0][n-1] << endl;
}

int main(int argc, char** argv)
{
	cin >> n;
	for(int i=0; i<n; i++)
	{
		cin >> a >> b;
		P p(a, b);
		D.push_back(p);
	}

	solve();
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:19:45: error: 'INT_MAX' was not declared in this scope
   19 |                         if(i!=j) DP[i][j] = INT_MAX;
      |                                             ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include <map>
  +++ |+#include <climits>
    4 |
Language: C++

#include <iostream>
#include <vector>
#include <climit>
#include <map>

using namespace std;

typedef pair<int, int> P;
vector<P> D;

int n, a, b;
int DP[101][101];

void solve()
{
	for(int i=0; i<n; i++)
	{
		for(int j=0; j<n; j++)
		{
			if(i!=j) DP[i][j] = INT_MAX;
			else DP[i][j] = 0;
		}
	}	

	for(int i=1; i<n; i++)
	{
		for(int j=0; j<n-i; j++)
		{
			for(int k=j; k<j+i; k++)
			{
				int cost = D[j].first * D[k].second * D[k+1].first * D[j+i].second;
				DP[j][j+i] = min(DP[j][j+i], cost + DP[j][k] + DP[k+1][j+i]);
			}
		}
	}

	cout << DP[0][n-1] << endl;
}

int main(int argc, char** argv)
{
	cin >> n;
	for(int i=0; i<n; i++)
	{
		cin >> a >> b;
		P p(a, b);
		D.push_back(p);
	}

	solve();
}

Compiler output:
a.cc:3:10: fatal error: climit: No such file or directory
    3 | #include <climit>
      |          ^~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
long long dp[101][101][101];
long long a[101],b[101];
#define rep(i,n) for(int i=0;i<n;i++)
int main(){
	int n;
	cin >> n;
	rep(i,n) cin >> a[i+1] >> b[i+1];
	
	rep(i,101)rep(j,101)rep(k,101) dp[i][j][k] = INT_MAX;
	for(int j=1;j<=n;j++)
			dp[0][j][j] = 0;
	for(int j=1;j<=n;j++){
		for(int k=1;k<=n;k++){
			if(j != k)dp[1][j][k] = a[j] * b[j] * a[k] * b[k];
		}
	}
	for(int i=2;i<=n;i++){
		for(int j=1;j<=n;j++){
			for(int k=1;k<=n;k++){
				dp[i][i][k] = min( dp[i][i][k] , dp[i-1][j][k] + a[i] * b[i] * a[j] * b[k] );
				dp[i][k][i] = min( dp[i][k][i] , dp[i-1][j][k] + a[i] * b[i] * a[k] * b[j] );
			}
		}
	}
	long long ans = INT_MAX;
	rep(i,n+1)rep(j,n+1) ans = min(ans,dp[n-1][i][j]);
	cout << ans << endl;
}	

Compiler output:
a.cc: In function 'int main()':
a.cc:13:54: error: 'INT_MAX' was not declared in this scope
   13 |         rep(i,101)rep(j,101)rep(k,101) dp[i][j][k] = INT_MAX;
      |                                                      ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include <algorithm>
  +++ |+#include <climits>
    4 | using namespace std;
a.cc:29:25: error: 'INT_MAX' was not declared in this scope
   29 |         long long ans = INT_MAX;
      |                         ^~~~~~~
a.cc:29:25: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
Language: C++

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>

using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
typedef complex<double> P;
static const double EPS = 1e-8;
static const int INF = (int)1e8;

#define FOR(i,k,n) for (int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n)
unsigned int dp[101][101];
int main(void){
  int n;  cin>>n;
  vector<PII> v(n);
  REP(i,n)cin>>v[i].first>>v[i].second;

  REP(i,n+1)REP(j,n+1)dp[i][j] = (i==j)?0:INF;

  FOR(i,1,n){
    REP(j,n-i+1){
      FOR(k,j,j+i){
        int cost = v[j].first * v[k].second * v[k+1].first * v[j+i].second;
        dp[j][j+i] = min(dp[j][j+1],cost+dp[j][k]+dp[k+1][j+i]);
      }
    }
  }
  cout<<dp[0][n-1]

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:19: error: expected ';' before 'return'
   42 |   cout<<dp[0][n-1]
      |                   ^
      |                   ;
   43 | 
   44 |   return 0;
      |   ~~~~~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

typedef pair<int,int> P;

int dp[101][101];
vector<P> v;

const int INF=(1<<31)-1;

int dfs(int d,int u){
	if(u==d)
		return 0;
	if(dp[d][u]!=INF)
		return dp[d][u];
	int minCost=INF;
	for(int i = d; i < u; i++){
		minCost=min(minCost,v[d].second*v[u].first*v[i].first*v[i+1].second+dfs(d,i)+dfs(i+1,u));
	}
	dp[d][u]=minCost;
	return dp[d][u];
}

int main(){

	int n;
	cin>>n;
	for(int i = 0; i < n; i++){
		int over,down;
		cin>>over>>down;
		v.push_back(P(over,down));
	}
	reverse(v.begin(),v.end());
	for(int i = 0; i < 101; i++)
		fill(dp[i],dp[i]+101,INF);
	cout<<dfs(0,n-1)<<endl;

	return 0;
}

Compiler output:
a.cc:11:22: warning: integer overflow in expression of type 'int' results in '2147483647' [-Woverflow]
   11 | const int INF=(1<<31)-1;
      |               ~~~~~~~^~
a.cc: In function 'int main()':
a.cc:35:9: error: 'reverse' was not declared in this scope
   35 |         reverse(v.begin(),v.end());
      |         ^~~~~~~
Language: C

#include <stdio.h>          // printf(), scanf()
#include <stdlib.h>         // abs()
#include <string.h>         // memset()
#include <stdbool.h>

#define MAX_N 15
#define MAX_S (1 << MAX_N)

const double INF = 1e10;

int n;
int s[MAX_N], l[MAX_N], p[MAX_N];
double dp[MAX_N][MAX_S];
int w[MAX_N][MAX_S];
short prev[MAX_N][MAX_S][2];
int ord[MAX_N];

int
main(int argc, char **argv)
{
	scanf("%d", &n);
	for (int i = 0; i < n; ++i)
		scanf("%d%d%d", &s[i], &l[i], &p[i]);

	memset(prev, -1, sizeof(prev));
	int S = 1;
	for (int i = 0; i < n; i++, S <<= 1)
		w[i][S] = p[i];

	int e = 1 << n;
	for (int k = 1; k < e; ++k)
	{
		S = 1;
		for (int i = 0; i < n; ++i, S <<= 1)
		{
			if (k & S)
				continue;

			int t = k | S;
			for (int j = 0; j < n; ++j)
			{
				if (i == j || w[j][k] == 0)
					continue;

				int d = abs(l[i] - l[j]);
				double x = dp[j][k] + d * ((70 + 20 * w[j][k])) / 2000.0);
				if (dp[i][t] == 0 || x < dp[i][t])
				{
					dp[i][t] = x;
					w[i][t] = w[j][k] + p[i];
					prev[i][t][0] = j;
					prev[i][t][1] = k;
				}
			}
		}
	}

	double min = INF;
	int u = 0;
	for (int i = 0; i < n; ++i)
	{
		double y = dp[i][e - 1];
		if (y == 0)
			continue;

		if (y < min)
		{
			min = y;
			u = i;
		}
	}

	ord[0] = u;
	int v = e - 1;
	for (int k = 1; k < n; ++k)
	{
		ord[k] = prev[u][v][0];
		v = prev[u][v][1];
		u = ord[k];
	}

	for (int i = n - 1; i >= 0; --i)
		printf("%d%c", s[ord[i]], (i != 0) ? ' ' : '\n');

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:46:89: error: expected ',' or ';' before ')' token
   46 |                                 double x = dp[j][k] + d * ((70 + 20 * w[j][k])) / 2000.0);
      |                                                                                         ^
Language: C

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

int i,j,n,num[20],dist[20],wei[20],next[10000000];

double search(int code,int weg,int now){
	
	if(code>=(int)pow(2.0,n)-1)return 0;

	int div=2,sel,i,wgg;
	double ttt=999999999,tim,addt;

	if(next[code]>=0){
		sel=now;wgg=weg;i=code;tim=0.0;

		while(i<(int)pow(2.0,n)-1){
			tim+=abs(dist[sel]-dist[next[i]])*(wgg+70)/2000.0;
			sel=i;
			wgg+=wei[i];
			i+=(int)pow(2.0,next[i]);
		}
		return tim;

	}

	for(i=0;i<n;i++,div*=2){
		if(code%div<div/2){
			if(now==-1)addt=0;
			else addt=abs(dist[now]-dist[i])*(weg+70)/2000.0;
			tim=addt+search(code+div/2,weg+wei[i],i);
			if(ttt>tim){ttt=tim;sel=i;}
		}
	}
	next[code]=sel;
	return ttt;

}

int main(){
	scanf("%d",&n);

	for(i=int(pow(2.0,n));i>=0;i--)next[i]=-1;
	
	for(i=0;i<n;i++){
		scanf("%d %d %d",&num[i],&dist[i],&wei[i]);
		wei[i]*=20;
	}

	search(0,0,-1);

	for(i=0,j=0;i<n;i++){
		printf("%d%s",num[next[j]],i<n-1?" ":"\n");
		j+=(int)pow(2.0,next[j]);
	}

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:43:15: error: expected expression before 'int'
   43 |         for(i=int(pow(2.0,n));i>=0;i--)next[i]=-1;
      |               ^~~
Language: C++

#include<iostream>
#include<vector>
#include<queue>
#include<map>
#include<functional>
#include<tuple>
#include<algorithm>
#include<cmath>
#include<cfloat>
using namespace std;

class Store {
public:
    double distance, gold;
    Store(double d, double g) :distance(d), gold(g) {}
};

enum {COST, GOLD, ID, PATH};
typedef tuple<double, double, int, vector<int>> Node;

double upperbound;

vector<int> bfs(const vector<Store>& store, int start) {
    int n = store.size();

    priority_queue<Node, vector<Node>, greater<Node>> q;
    q.push(Node(0.0, 0.0, start, {start}));
    while(!q.empty()) {
        Node current = q.top(); q.pop();
        if(get<COST>(current) >= upperbound) break;
        if(get<PATH>(current).size() == n) {
            upperbound = get<COST>(current);
            return get<PATH>(current);
        }
        for(int i = 0; i < n; ++i) {
            vector<int> path = get<PATH>(current);
            if(find(path.begin(), path.end(), i) != path.end()) continue;
            int id = get<ID>(current);
            double gold = get<GOLD>(current);
            double cost = get<COST>(current);
            gold += store[id].gold;
            cost += fabs(store[id].distance - store[i].distance) * (70.0 + gold) / 2000.0;
            path.push_back(i);
            q.push(Node(cost, gold, i, path));
        }
    }
    return vector<int>;
}

int main() {
    int n;
    cin >> n;

    vector<Store> store;
    map<int, int> id;
    for(int i = 0; i < n; ++i) {
        int no;
        double distance, gold;
        cin >> no >> distance >> gold;
        id[id.size()] = no;
        store.push_back(Store(distance, gold * 20.0));
    }

    vector<int> answer;
    upperbound = DBL_MAX;
    for(int i = 0; i < n; ++i) {
        vector<int> result = bfs(store, i);
        if(!result.empty()) answer = result;
    }
    for(int i = 0; i < answer.size(); ++i) cout << (i == 0 ? "" : " ") << id[answer[i]];
    cout << endl;
}

Compiler output:
a.cc: In function 'std::vector<int> bfs(const std::vector<Store>&, int)':
a.cc:47:23: error: expected primary-expression before ';' token
   47 |     return vector<int>;
      |                       ^
Language: C++

// AOJ 0146
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<limits>
#include<vector>
#define rep(i,a) for( int i = 0; i != (a); ++i )
#define repi(i,a,b) for( int i = (a); i != (b); ++i )

const int MAX_V = 15;
const double INF = std::numeric_limits<double>::max()/4.0;

int n;
int ord[MAX_V], d[MAX_V], w[MAX_V];
double dp[MAX_V][1<<MAX_V];
double ans = INF;
int ansOrd[MAX_V];

void rec( int v, double t, int ws, int S, std::vector<int> &ords )
{
	if( t > dp[v][S] )
		return;

	if( S == (1<<n)-1 && ans > t )
	{
		ans = t;

		rep( i, n )
			ansOrd[i] = ords[i];
		
		return;
	}

	rep( u, n )
	{
		if( !(S>>u&1) )
		{
			double vel = 2000.0/(70.0+ws), tim = t+abs(d[u]-d[v])/vel;
			ords.push_back( ord[u] );
			if( dp[u][S|1<<u] > tim )
			{
				dp[u][S|1<<u] = tim;
				rec( u, tim, ws+w[u]*20, S|1<<u, ords );
			}
			ords.pop_back();
		}
	}

	return;
}

int main()
{
	scanf( "%d", &n );
	rep( i, n )
		scanf( "%d%d%d", ord+i, d+i, w+i );

	std::fill( (double*)dp, (double*)(size_t(dp)+sizeof(dp)), INF );

	rep( i, n )
		rec( i, 0, w[i]*20, 1<<i, std::vector<int>( 1, ord[i] ) );

	rep( i, n )
		printf( "%d%c", ansOrd[i], i==n-1?'\n':' ' );

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:61:48: error: cannot bind non-const lvalue reference of type 'std::vector<int>&' to an rvalue of type 'std::vector<int>'
   61 |                 rec( i, 0, w[i]*20, 1<<i, std::vector<int>( 1, ord[i] ) );
      |                                                ^~~~~~~~~~~~~~~~~~~~~~~~
a.cc:19:61: note:   initializing argument 5 of 'void rec(int, double, int, int, std::vector<int>&)'
   19 | void rec( int v, double t, int ws, int S, std::vector<int> &ords )
      |                                           ~~~~~~~~~~~~~~~~~~^~~~
Language: C++

# define _CRT_SECURE_NO_WARNINGS 1
# define _USE_MATH_DEFINES
# include <iostream>
# include <intrin.h>
# include <numeric>
# include <string>
# include <bitset>
# include <vector>
# include <algorithm>
# include <cstdlib>
# include <cstdio>
# include <cstring>
# include <cstdlib>
# include <iomanip>
# include <queue>
# include <sstream>
# include <climits>
# include <cmath>
# include <list>
# include <functional>
# include <string>
# include <ctime>
# include <set>
# include <forward_list>
# include <map>
# include <stack>
using namespace std;

# define INF ((int)(1<<25))
# define REP(i,n) for(int i=0;i<(int)n;i++)
# define FOR(i,n) REP(i,n)
# define TORAD 2.0*M_PI/360.0
# define INT(x) int x;cin>>x;
# define ALL(x) (x).begin(),(x).end()
# define RALL(x) (x).rbegin(),(x).rend()
# define DEBUG(x) cout<<#x<<" :"<<x<<endl;
# define EPS 1e-12



template<class T> void debug(T a) { for (auto i : a)cout << i << endl; }

typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef pair<int, pii> piii;
int dx[4] = { 0,1,0,-1 }, dy[4] = { -1,0,1,0 };

typedef pair< double, vi > pdv;
int n;
int dis[17] = {}, num[17] = {}, vol[17] = {};
pdv memo[1 << 15][16];

double calcw(int bit)
{
	double ans = 0.0;
	for (int i = 0; i < n; i++)
	{
		if (bit & 1 << i)ans += vol[i] * 20.0;
	}
	return ans;
}

pdv dp(int bit, int prev)
{
	if (__popcnt(bit) == n)return pdv(0.0, {});
	if (memo[bit][prev].first >= 0.0)return memo[bit][prev];

	double w = calcw(bit);
	double speed = 2000.0 / (70.0 + w);
	pdv ans(9999999999.0, {});
	for (int i = 0; i < n; i++)
	{
		if (bit & 1 << i)continue;
		pdv s = dp(bit | 1 << i, i);
		s.first += 1.0*abs(dis[i] - dis[prev]) / speed;
		if (ans.first > s.first)
		{
			ans = s;
			ans.second.push_back(num[i]);
		}
	}

	return memo[bit][prev] = ans;
}
int main()
{
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> num[i] >> dis[i] >> vol[i];
	}
	for (int i = 0; i < 1 << 15; i++)
	{
		for (int j = 0; j < 16; j++)
		{
			memo[i][j] = pdv(-1.0, {});
		}
	}
	pdv ans = dp(0, n);
	reverse(ALL(ans.second));
	for (int i = 0; i < n; i++)
	{
		if (i)cout << " ";
		cout << ans.second[i];
	}
	cout << endl;
}

Compiler output:
a.cc:4:11: fatal error: intrin.h: No such file or directory
    4 | # include <intrin.h>
      |           ^~~~~~~~~~
compilation terminated.
Language: C++

# define _CRT_SECURE_NO_WARNINGS 1
# define _USE_MATH_DEFINES
# include <iostream>
# include <numeric>
# include <string>
# include <bitset>
# include <vector>
# include <algorithm>
# include <cstdlib>
# include <cstdio>
# include <cstring>
# include <cstdlib>
# include <iomanip>
# include <queue>
# include <sstream>
# include <climits>
# include <cmath>
# include <list>
# include <functional>
# include <string>
# include <ctime>
# include <set>
# include <forward_list>
# include <map>
# include <stack>
using namespace std;

# define INF ((int)(1<<25))
# define REP(i,n) for(int i=0;i<(int)n;i++)
# define FOR(i,n) REP(i,n)
# define TORAD 2.0*M_PI/360.0
# define INT(x) int x;cin>>x;
# define ALL(x) (x).begin(),(x).end()
# define RALL(x) (x).rbegin(),(x).rend()
# define DEBUG(x) cout<<#x<<" :"<<x<<endl;
# define EPS 1e-12



template<class T> void debug(T a) { for (auto i : a)cout << i << endl; }

typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef pair<int, pii> piii;
int dx[4] = { 0,1,0,-1 }, dy[4] = { -1,0,1,0 };

typedef pair< double, vi > pdv;
int n;
int dis[17] = {}, num[17] = {}, vol[17] = {};
pdv memo[1 << 15][16];

double calcw(int bit)
{
	double ans = 0.0;
	for (int i = 0; i < n; i++)
	{
		if (bit & 1 << i)ans += vol[i] * 20.0;
	}
	return ans;
}

pdv dp(int bit, int prev)
{
	if (__popcnt(bit) == n)return pdv(0.0, {});
	if (memo[bit][prev].first >= 0.0)return memo[bit][prev];

	double w = calcw(bit);
	double speed = 2000.0 / (70.0 + w);
	pdv ans(9999999999.0, {});
	for (int i = 0; i < n; i++)
	{
		if (bit & 1 << i)continue;
		pdv s = dp(bit | 1 << i, i);
		s.first += 1.0*abs(dis[i] - dis[prev]) / speed;
		if (ans.first > s.first)
		{
			ans = s;
			ans.second.push_back(num[i]);
		}
	}

	return memo[bit][prev] = ans;
}
int main()
{
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> num[i] >> dis[i] >> vol[i];
	}
	for (int i = 0; i < 1 << 15; i++)
	{
		for (int j = 0; j < 16; j++)
		{
			memo[i][j] = pdv(-1.0, {});
		}
	}
	pdv ans = dp(0, n);
	reverse(ALL(ans.second));
	for (int i = 0; i < n; i++)
	{
		if (i)cout << " ";
		cout << ans.second[i];
	}
	cout << endl;
}

Compiler output:
a.cc: In function 'pdv dp(int, int)':
a.cc:65:13: error: '__popcnt' was not declared in this scope
   65 |         if (__popcnt(bit) == n)return pdv(0.0, {});
      |             ^~~~~~~~
Language: Java


import static java.util.Arrays.deepToString;

import java.util.Arrays;
import java.util.PriorityQueue;
import java.util.Scanner;
import java.util.concurrent.PriorityBlockingQueue;

public class Main_pq {
	public static void main(String[] args) {
		new Main_pq().run();
	}
	void tr(Object... os) {
		System.err.println(deepToString(os));
	}

	Scanner sc = new Scanner(System.in);
	
	public void run() {
		int[] ans = new int[100];
		
		PriorityQueue<Event> pq = new PriorityQueue<Event>();
		int[] table = new int[17];
		Arrays.fill(table, -1);
		int nextGroup = 0;
		for (int i = 0; i < 100; i++) {
			Event e = new Event();
			e.id = i;
			e.move = Event.ARRIVE;
			e.initTime = i * 5;
			e.time = i * 5;
			e.num = i % 5 == 1 ? 5 : 2;
			e.duration = 17*(i%2) + 3*(i%3)+19;
			pq.add(e);
		}
		while (!pq.isEmpty()) {
			Event e = pq.poll();
			if (e.move == Event.LEAVE) {
				for (int i = 0; i < table.length; i++) {
					if (table[i] == e.id) table[i] = -1;
				}
			} else if (e.move == Event.ARRIVE) {
				int pos = -1;
				if (nextGroup == e.id) {
					for (int i = 0; i + e.num <= table.length; i++) {
						boolean ok = true;
						for (int j = 0; j < e.num; j++) {
							if (table[i+j] != -1) {
								ok = false;
								break;
							}
						}
						if (ok) {
							pos = i;
							break;
						}
					}
				}
				if (pos >= 0) {
					// 座る
					ans[e.id] = e.time - e.initTime;
					for (int j = 0; j < e.num; j++) {
						table[pos + j] = e.id;
					}
					e.time += e.duration;
					e.move = Event.LEAVE;
					pq.add(e);
					nextGroup++;
				} else {
					// 空いてなければ待つ。時刻+1して席が空くのを待つ手抜き実装
					e.time++;
					pq.add(e);
				}
			}
		}
		for (;sc.hasNext();) {
			int n = sc.nextInt();
			System.out.println(ans[n]);
		}
	}
	
	class Event implements Comparable<Event> {
		static final int LEAVE = 0;
		static final int ARRIVE = 1;
		int id;
		int initTime;
		int move;
		int time;
		int num;
		int duration;
		@Override
		public int compareTo(Event o) {
			int c = time - o.time;
			if (c == 0) c = move - o.move;
			if (c == 0) c = id - o.id;
			return c;
		}
	}
}

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

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class M2ain {

    public static void main(String[] args) {

        int[] seats = new int[] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0};
        int[] groupMembers = new int[] {2, 5, 2, 2, 2};
        int[] eatTimes = new int[] {19, 39, 25, 36, 22, 42};

        int headGroup = -1;
        int pastMinutes = 0;
        List<Integer> waitTime = new ArrayList<Integer>();

        while (waitTime.size() <= 100) {
            // たべおわる
            for (int i = 0; i < seats.length; i++) {
                seats[i] = seats[i] == 0 ? 0 : seats[i] - 1;
            }

            // 来店
            if (headGroup == -1 && pastMinutes % 5 == 0) {
                headGroup = pastMinutes / 5;
            }

            // ちゃくせき
            while (headGroup != -1) {
                int needsSequencialSeats = groupMembers[headGroup % 5];
                int sequencialSeats = 0;
                int startIndex = -1;
                for (int i = 0; i < seats.length; i++) {
                    sequencialSeats = seats[i] == 0 ? sequencialSeats + 1 : 0;

                    if (sequencialSeats == needsSequencialSeats) {
                        startIndex = i - (needsSequencialSeats - 1);
                        break;
                    }
                }

                if (startIndex != -1) {
                    // すわれたみたい
                    waitTime.add(headGroup, pastMinutes - (headGroup * 5));
                    for (int i = startIndex; i < (startIndex + needsSequencialSeats); i++) {
                        seats[i] = eatTimes[headGroup % 6];
                    }

                    headGroup = ((headGroup * 5) < pastMinutes) ? headGroup + 1
                            : -1;
                } else {
                    // すわれなかったみたい
                    break;
                }

            }

            pastMinutes++;

        }

        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            System.out.println(waitTime.get(sc.nextInt()));
        }

    }
}

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

<?php

$waitTime = array(0,
0,
0,
0,
0,
0,
14,
9,
4,
0,
0,
8,
3,
2,
0,
0,
15,
10,
15,
10,
6,
12,
7,
9,
11,
6,
23,
18,
13,
8,
3,
23,
18,
13,
8,
3,
34,
29,
24,
22,
17,
28,
23,
24,
19,
27,
34,
29,
35,
30,
28,
31,
28,
23,
24,
28,
42,
37,
32,
27,
22,
42,
37,
32,
27,
22,
53,
48,
43,
41,
36,
47,
42,
43,
38,
46,
64,
59,
54,
49,
44,
61,
56,
51,
46,
44,
72,
67,
62,
57,
52,
72,
67,
62,
57,
52,
83,
78,
73,
71);

while($input = fscanf(STDIN, "%d")){
  fprintf(STDOUT, "%d\n", $waitTime[$input]);
}
return(0);
?>

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
<?php
^
Main.java:104: error: class, interface, enum, or record expected
while($input = fscanf(STDIN, "%d")){
^
Main.java:106: error: class, interface, enum, or record expected
}
^
Main.java:108: error: class, interface, enum, or record expected
?>
^
4 errors
Language: Java

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * プログラミングコンテスト<br>
 * 0147:Fukushimaken
 *
 * @author t690593
 *
 */
public class Fukushimaken {

	/** 最大グループ数 */
	static final int MAX_GROUP_NUKMBER = 100;

	/** 客の到着間隔 */
	static final int TIME_INTERVAL = 5;

	/** 座席 */
	static int[] sheets = new int[17];

	/** 各グループの待ち時間 */
	static int[] waitTimes = new int[100];

	/** インプット */
	static List<Integer> inputs = new ArrayList<Integer>();

	/** インプットの最大グループ番号 */
	static int maxGroupNumber;

	/**
	 * メイン
	 *
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		while (scanner.hasNextInt()) {
			int inputNum = scanner.nextInt();
			if (maxGroupNumber < inputNum) {
				maxGroupNumber = inputNum;
			}
			inputs.add(inputNum);
		}

		// 先頭のグループ番号
		int frontGroup = 0;
		// 最後尾のグループ番号
		int endGroup = 0;
		// 経過時間：分単位
		int time = 0;

		while (true) {
			// 5分間隔でお店に客がくる（最後尾は最大グループ数より大きくならない）
			if (time % TIME_INTERVAL == 0 && endGroup < MAX_GROUP_NUKMBER) {
				endGroup++;
			}

			for (int i = frontGroup; i < endGroup; i++) {
				int ninzu = i % 5 == 1 ? 5 : 2;
				int startPos = getOpendSheetsPosition(ninzu);
				if (startPos >= 0) {
					// 座れる場合
					secureSheets(startPos, calcMealtime(i), ninzu);
					waitTimes[i] = time - i * 5;
					frontGroup++;
				} else {
					// 座れない場合
					break;
				}

			}

			// 入力されたグループ番号の最大番号が席に座るか、全てのグループが席に座ったら終了
			if (frontGroup == MAX_GROUP_NUKMBER || frontGroup > maxGroupNumber) {
				break;
			}

			// 座席の食事時間を時間経過とともに減らす
			for (int i = 0; i < sheets.length; i++) {
				if (sheets[i] > 0) {
					sheets[i] = sheets[i] - 1;
				}
			}

			time++;
		}

		for (int input : inputs) {
			System.out.println(waitTimes[input]);
		}
	}

	/**
	 * 空いている席の最初の席番号を返却する<br>
	 * 席が空いていない場合、-1を返却する
	 *
	 * @param peopleNum
	 *            グループの人数
	 * @return 空いている席の最初の席番号
	 */
	private static int getOpendSheetsPosition(int peopleNum) {
		int startPos = -1;
		int openedSheetNum = 0;
		for (int i = 0; i < sheets.length; i++) {
			if (sheets[i] == 0) {
				if (startPos == -1) {
					startPos = i;
				}
				openedSheetNum++;
			} else {
				startPos = -1;
				openedSheetNum = 0;
			}

			if (openedSheetNum == peopleNum) {
				return startPos;
			}
		}
		return -1;
	}

	/**
	 * 対象グループの食事時間を計算する
	 *
	 * @param targetGroup
	 *            対象グループ番号
	 * @return 食事間
	 */
	private static int calcMealtime(int targetGroup) {
		return 17 * (targetGroup % 2) + 3 * (targetGroup % 3) + 19;
	}

	/**
	 * 座席を確保する
	 *
	 * @param startPos
	 *            席確保する最初の席番号
	 * @param mealtime
	 *            確保する時間（食事時間）
	 * @param peopleNum
	 *            グループ人数
	 */
	private static void secureSheets(int startPos, int mealtime, int peopleNum) {
		for (int i = 0; i < peopleNum; i++) {
			sheets[i + startPos] = mealtime;
		}
	}
}

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

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
 
public class Main {
 
    public static void main(String[] args) {
 
        int[] seats = new int[] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0};
        int[] groupMembers = new int[] {2, 5, 2, 2, 2};
        int[] eatTimes = new int[] {19, 39, 25, 36, 22, 42};
 
        int headGroup = -1;
        int pastMinutes = 0;

        Scanner sc = new Scanner(System.in);

      List<Integer> inputted = new ArrayList<Integer>();
      int maxInputted = -1;
      while (sc.hasNext()) {
        int ni = sc.nextInt();
        maxInputted = maxInputted < ni ? ni : maxInputted;
        inputted.put(ni);
      }
      
        List<Integer> waitTime = new ArrayList<Integer>();
 
        while (waitTime.size() <= maxInputted) {
            // たべおわる
            for (int i = 0; i < seats.length; i++) {
                seats[i] = seats[i] == 0 ? 0 : seats[i] - 1;
            }
 
            // 来店
            if (headGroup == -1 && pastMinutes % 5 == 0) {
                headGroup = pastMinutes / 5;
            }
 
            // ちゃくせき
            while (headGroup != -1) {
                int needsSequencialSeats = groupMembers[headGroup % 5];
                int sequencialSeats = 0;
                int startIndex = -1;
                for (int i = 0; i < seats.length; i++) {
                    sequencialSeats = seats[i] == 0 ? sequencialSeats + 1 : 0;
 
                    if (sequencialSeats == needsSequencialSeats) {
                        startIndex = i - (needsSequencialSeats - 1);
                        break;
                    }
                }
 
                if (startIndex != -1) {
                    // すわれたみたい
                    waitTime.add(headGroup, pastMinutes - (headGroup * 5));
                    for (int i = startIndex; i < (startIndex + needsSequencialSeats); i++) {
                        seats[i] = eatTimes[headGroup % 6];
                    }
 
                    headGroup = (((headGroup + 1) * 5) <= pastMinutes) ? headGroup + 1
                            : -1;
                } else {
                    // すわれなかったみたい
                    break;
                }
 
            }
 
            pastMinutes++;
 
        }

      for(int input : inputted){
        System.out.println(waitTime.get(input));
      }

 
    }
}

Compiler output:
Main.java:24: error: cannot find symbol
        inputted.put(ni);
                ^
  symbol:   method put(int)
  location: variable inputted of type List<Integer>
1 error
Language: C++

#include<queue>
#include<cstdio>

#define	mp	make_pair
#define	EMPTY	-1

using namespace std;

typedef	pair<int,int>	pii;

int Numbers(int groupid){
	return groupid%5==1?5:2;
}

int MealTime(int groupid){
	return 17*(groupid%2)+3*(groupid%3)+19;
}

int main()
{
	int counter[17],elapse[17],mealtime[17];
	queue<pii> qu;	// <numbers in a group, group id>

	for(int i=0;i<17;i++)	counter[i]=EMPTY;

	int waittime[100];
	for(int t=0;t<589;t++){
		// enqueue
		if(t%5==0&&t<500){
			qu.push(mp(Numbers(t/5),t/5));
		}

		// going
		for(int i=0;i<17;i++){
			if(counter[i]!=EMPTY){
				elapse[i]++;
				if(elapse[i]==mealtime[i])	counter[i]=EMPTY;
			}
		}

		// coming
		if(!qu.empty()){
			pii next=qu.front();
			for(int i=0,cnt=0;i<17;i++){
				if(counter[i]==EMPTY)	cnt++;
				else					cnt=0;
				if(cnt==next.first){
					waittime[next.second]=t-5*next.second;
					int mt=MealTime(next.second);
					for(int j=i;j>i-next.first;j--){
						counter[j]=next.second;
						mealtime[j]=MealTime(next.second);
						elapse[j]=0;
					}
					cnt=0;
					qu.pop();
					if(qu.empty())	break;
					next=qu.front();
				}
			}
		}
	}

	for(int n;~scanf("%d",&n))	printf("%d\n",waittime[n]);

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:64:34: error: expected ';' before ')' token
   64 |         for(int n;~scanf("%d",&n))      printf("%d\n",waittime[n]);
      |                                  ^
      |                                  ;
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<n;i++)
int main(){
	int seat[17] = {0};
	int X = 0;
	int stop[100] = {0};
	int time = 0;
	queue<int> Q;
	while(X < 100){
		int x;
		if(time%5 == 0 && time < 500){
			Q.push(time/5);
		}
		while(1){
			if(Q.size())x = Q.front();
			else x = -1;
			bool f = false;
			
			if(~x){
				int people = (x%5==1?5:2);
				int use = 19 + 3 * (x%3) + 17 * (x%2);
				rep(i,17-people+1){
					bool flag = true;
					rep(j,people){
						flag &= seat[i+j] == 0;
					}
					if(flag){
						rep(j,people){
							seat[i+j] = use;
						}
						f = true;
						break;
					}
				}
			}
			if(f){	
				stop[x] = time - x * 5;
				Q.pop();
				X++;
			}
			if(!f)break;
		}
		rep(i,17){
			seat[i] = max(0,seat[i]-1);
		}
		time++;
	}
	int n,c=0;
	
	while(cin >> n){
		if(n < 50)c++;
		cout << stop[n] << endl;
	}
	while(c>=5){return 1};
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:59:29: error: expected ';' before '}' token
   59 |         while(c>=5){return 1};
      |                             ^
      |                             ;
Language: C++

main(){
	int n,c=0;
	while(~scanf("%d",&n)){
		if(n==98)c++;
	}
	return (c?1:0);
}

Compiler output:
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    1 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:3:16: error: 'scanf' was not declared in this scope
    3 |         while(~scanf("%d",&n)){
      |                ^~~~~