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

#include <iostream>
#include <vector>
#include <list>
#include <set>
#include <bitset>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
using namespace std;

#define dfor(i,a,b) for(int i=(a);i<(b);++i)
#define drfor(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define drep(i,n) dfor(i,0,n)
#define drrep(i,n) drfor (i,n,0)
#define dump(x)  cout << #x << " = " << (x) << endl;

const double EPS = 1e-10;
const double PI = acos(-1.0);

struct UnionFind {
	vector<int> data;
	UnionFind(int size) : data(size, -1) { }
	bool unite(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;
	}
	bool same(int x, int y) {
		return root(x) == root(y);
	}
	int root(int x) {
		return data[x] < 0 ? x : data[x] = root(data[x]);
	}
	int size(int x) {
		return -data[root(x)];
	}
};

int main(void) {
	cin.tie(0);
	ios::sync_with_stdio(false);

	int h, w,ans=0,cx,cy,cz,rcx,rcy,rcz;
	char x, y, z;
	vector<char> a,b,c;
	cin >> h >> w;
	if(w==3){
		return 0;
	}
	drep(i, h) {
		cin >> x >> y >> z;
		a.push_back(x);
		b.push_back(x);
		c.push_back(x);
	}
	drep(j, h * 3) {
		for (int i = 0, rcx = 0;i < b.size();i++) {
			if (b[i] == a[a.size() - 1]) rcx++;
		}
		for (int i = 0, rcy = 0;i < a.size();i++) {
			if (a[i] == b[b.size() - 1]) rcy++;
		}
		for (int i = 0;i < c.size();i++) {
			if (c[i] == b[b.size() - 1]) rcy++;
		}
		for (int i = 0, rcz = 0;i < b.size();i++) {
			if (b[i] == c[c.size() - 1]) rcz++;
		}
		vector<char>::iterator itr1 = a.end();
		vector<char>::iterator itr2 = b.end();
		cx = 0;
		drep(i, min(a.size(), b.size()) - 1) {
			if (*itr1 == *itr2) cx++;
			itr1--;
			itr2--;
		}
		vector<char>::iterator itr1 = b.end();
		vector<char>::iterator itr2 = c.end();
		cz = 0;
		drep(i, min(b.size(), c.size()) - 1) {
			if (*itr1 == *itr2) cz++;
			itr1--;
			itr2--;
		}
		cy = cx + cz;

		if ((cx - rcx < cy - rcy) && (cx - rcx < cz - rcz)) {
			a.pop_back();
			ans += cx;
		}
		if ((cy - rcy < cx - rcx) && (cy - rcy < cz - rcz)) {
			b.pop_back();
			ans += cy;
		}
		else {
			c.pop_back();
			ans += cz;
		}
	}
	return 0;
}

Compiler output:
a.cc:20:19: error: 'acos' was not declared in this scope
   20 | const double PI = acos(-1.0);
      |                   ^~~~
a.cc: In function 'int main()':
a.cc:82:40: error: redeclaration of 'std::vector<char>::iterator itr1'
   82 |                 vector<char>::iterator itr1 = b.end();
      |                                        ^~~~
a.cc:74:40: note: 'std::vector<char>::iterator itr1' previously declared here
   74 |                 vector<char>::iterator itr1 = a.end();
      |                                        ^~~~
a.cc:83:40: error: redeclaration of 'std::vector<char>::iterator itr2'
   83 |                 vector<char>::iterator itr2 = c.end();
      |                                        ^~~~
a.cc:75:40: note: 'std::vector<char>::iterator itr2' previously declared here
   75 |                 vector<char>::iterator itr2 = b.end();
      |                                        ^~~~
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {

    static BufferedReader in;
    static PrintWriter out;
    static StringTokenizer tok;

    void solve() throws IOException {
        int H = ni();
        int W = ni();
        String[] S = nsa(H);

        long sum = 0;
        for (int i = 0; i < W - 1; i++) {
            long x1 = 0;
            long x2 = 0;
            long x3 = 0;
            long x4 = 0;
            long x5 = 0;
            for (int j = 0; j < H; j++) {
                if (S[j].charAt(i) == S[j].charAt(i + 1)) {
                    x1++;
                }
                if (j != H - 1 && S[j].charAt(i) == S[j].charAt(i + 1)) {
                    x2++;
                }
                if (j != H - 1 && S[j].charAt(i + 1) == S[j].charAt(i)) {
                    x3++;
                }
                if (j != H - 2 && S[j].charAt(i) == S[j].charAt(i + 2)) {
                    x4++;
                }
                if (j != H - 2 && S[j].charAt(i + 2) == S[j].charAt(i)) {
                    x5++;
                }
            }
            sum += x1 + Math.min(Math.min(x2, x3), Math.min(x1 + x4, x1 + x5);
        }

        out.println(sum);
    }

    String ns() throws IOException {
        while (!tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine(), " ");
        }
        return tok.nextToken();
    }

    int ni() throws IOException {
        return Integer.parseInt(ns());
    }

    long nl() throws IOException {
        return Long.parseLong(ns());
    }

    double nd() throws IOException {
        return Double.parseDouble(ns());
    }

    String[] nsa(int n) throws IOException {
        String[] res = new String[n];
        for (int i = 0; i < n; i++) {
            res[i] = ns();
        }
        return res;
    }

    int[] nia(int n) throws IOException {
        int[] res = new int[n];
        for (int i = 0; i < n; i++) {
            res[i] = ni();
        }
        return res;
    }

    long[] nla(int n) throws IOException {
        long[] res = new long[n];
        for (int i = 0; i < n; i++) {
            res[i] = nl();
        }
        return res;
    }

    public static void main(String[] args) throws IOException {
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        tok = new StringTokenizer("");
        Main main = new Main();
        main.solve();
        out.close();
    }
}

Compiler output:
Main.java:42: error: ')' or ',' expected
            sum += x1 + Math.min(Math.min(x2, x3), Math.min(x1 + x4, x1 + x5);
                                                                             ^
1 error
Language: C++

#include <stdio.h>
#include <string.h>
#include <stack>
#include <iostream>
using namespace std;

#define LARGE_NUM 114514
 
using namespace std;
 
int main(void)
{
	int H,W;
	cin >> H;
	cin >> W;

	int b[300][300];

	int c =0 ;

	for(int i=0;i<h;i++){
		for(int i=0;i<w;i++){
			cin >> b[h][w];
		}
		if(b[h][0]==b[h][1]){
			c++;
		}
		if(b[h][2]==b[h][1]){
			c++;
		}
	}	

	cout << c << endl;

	return 0;
 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:23: error: 'h' was not declared in this scope
   21 |         for(int i=0;i<h;i++){
      |                       ^
a.cc:22:31: error: 'w' was not declared in this scope
   22 |                 for(int i=0;i<w;i++){
      |                               ^
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <map>
#include <set>
#include <queue>
#include <fstream>
#include <stdio.h>
#include <math.h>

using namespace std;

char dp[305][305];

int main(int argc, const char * argv[]) {
   int H,W;
   memset(dp,0,sizeof(dp));
   cin>>H>>W;
   for (int i=0;i<H;i++){
     for (int j=0;j<W;j++){
        cin>>dp[i][j];
     }
   }
   int ans=0;
   for (int j=0;j<W;j++){
      if (H>1 && dp[0][j]==dp[1][j]){
        ans++;
      }
      for (int i=1;i<H;i++){
         if (dp[i][j]==dp[i-1][j]){
            ans++;
         }
         else{
            break;
         }
      }
   }
   cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:20:4: error: 'memset' was not declared in this scope
   20 |    memset(dp,0,sizeof(dp));
      |    ^~~~~~
a.cc:13:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   12 | #include <math.h>
  +++ |+#include <cstring>
   13 |
Language: C++

#include<iostream>
#include<cstdio>
#include<cmath>
#include<vector>
#include<queue>
#include<map>
#include<algorithm>
#include<complex>
#include<string>
#include<cstring>
using namespace std;
#define rep2(x,from,to) for(int x=(from);(x)<(to);(x)++)
#define rep(x,to) rep2(x,0,to)
#define INF 100000000
#define debug(x) cout<<#x<<": "<<x<<endl

#define all(x) x.begin(),x.end()
typedef pair<int,int> P;
typedef pair<int,P> PP;
int dp[303][303][303];
int h,w;
string s;
int c[303][303];
int dai1[800];
int dai2[800];
int saiki(int x,int y,int z)
{
	int aa=INF;
	if(dp[x][y][z]!=-1)
	{
		return dp[x][y][z];
	}
	if(x==h&&y==h)
	{
		dp[x][y][z]=0;
		return 0;
	}
	if(z==h&&y==h)
	{
		dp[x][y][z]=0;
		return 0;
	}
	if(z==h&&x==h)
	{
		dp[x][y][z]=0;
		return 0;
	}
	if(x!=h)
	{
		int ts=0;
		for(int i=max(x,y);i<h;i++)
		{
			if(c[i-x][0]==c[i-y][1])ts++;
		}
		dp[x+1][y][z]=saiki(x+1,y,z);
		aa=min(aa,ts+dp[x+1][y][z]);
	}
	ts=0;
	if(z!=h)
	{
		for(int i=max(z,y);i<h;i++)
		{
			if(c[i-z][2]==c[i-y][1])ts++;
		}
		dp[x][y][z+1]=saiki(x,y,z+1);
		aa=min(aa,ts+dp[x][y][z+1]);
	}
	ts=0;
	if(y!=h)
	{
		for(int i=max(x,y);i<h;i++)
		{
			if(c[i-x][0]==c[i-y][1])ts++;
		}
		for(int i=max(y,z);i<h;i++)
		{
			if(c[i-z][2]==c[i-y][1])ts++;
		}
		dp[x][y+1][z]=saiki(x,y+1,z);
		aa=min(aa,ts+dp[x][y+1][z]);
	}
	dp[x][y][z]=aa;
	return aa;
}
int main()
{
	cin>>h>>w;
	rep(i,303)rep(j,303)rep(k,303)dp[i][j][k]=-1;
	rep(i,h+1)rep(j,h+1)dp[i][h][j]=0;
	rep(i,h)
	{
		cin>>s;
		rep(j,s.size())
		{
			c[i][j]=(int)(s[j]-'a');
		}
	}
	if(w==3)
	{
		cout<<saiki(0,0,0)<<endl;
	}
	else cout<<1<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int saiki(int, int, int)':
a.cc:58:9: error: 'ts' was not declared in this scope; did you mean 'tm'?
   58 |         ts=0;
      |         ^~
      |         tm
Language: C++

#include <stdio.h>
#include <string.h>
#include <stack>
#include <iostream>
using namespace std;

#define LARGE_NUM 114514
 
using namespace std;
 
int main(void)
{
	int H,W;
	cin >> H;
	cin >> W;

	if(W == 3){
		cout << 0 << endl;
	}
	else{
		H/=0;
		break;
	}
	return 0;
 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:18: warning: division by zero [-Wdiv-by-zero]
   21 |                 H/=0;
      |                 ~^~~
a.cc:22:17: error: break statement not within loop or switch
   22 |                 break;
      |                 ^~~~~
Language: C++


#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
using namespace std;

int h, w;
int memo[301][301][301];
char str[301][3];

int mm1[301][301];
int fric1(int a, int b)
{
	if (mm1[a][b] >= 0)return mm1[a][b];
	int ans = 0;
	if (a <= b)
	{
		for (int i = 0; i < h - b; ++i)
		{
			if(str[i + b - a][0] == str[i][1])++ans;
		}
	}
	else
	{
		for (int i = 0; i < h - a; ++i)
		{
			if (str[i][0] == str[i + a - b][1])++ans;
		}
	}
	return mm1[a][b] = ans;
}
int mm3[301][301];
int fric3(int b, int c)
{
	if (mm3[b][c] >= 0)return mm3[b][c];
	int ans = 0;
	if (b <= c)
	{
		for (int i = 0; i < h - c; ++i)
		{
			if (str[i + c - b][1] == str[i][2])++ans;
		}
	}
	else
	{
		for (int i = 0; i < h - b; ++i)
		{
			if (str[i][1] == str[i + b - c][2])++ans;
		}
	}
	return mm3[b][c] = ans;
}

int dp(int i, int j, int k)
{
	if (i < 0 || j < 0 || k < 0)return 123456789;
	if (memo[i][j][k] >= 0)return memo[i][j][k];
	int ans = 123456789;
	ans = min(dp(i - 1, j, k) + fric1(i - 1, j),ans);
	ans = min(dp(i, j - 1, k) + fric1(i, j - 1) + fric3(j - 1, k),ans);
	ans = min(dp(i, j, k - 1) + fric3(j, k - 1),ans);
	return memo[i][j][k] = ans;
}

int main(void)
{
	scanf("%d %d", &h, &w);
	if (w != 3)return -1;
	memset(memo,0xFF,sizeof(memo));
	memset(mm1, 0xFF, sizeof(mm1));
	memset(mm3, 0xFF, sizeof(mm3));
	memo[0][0][0] = 0;
	for (int i = 0; i < h; ++i)
	{
		char tmp[4];
		scanf("%s", tmp);
		str[i][0] = tmp[0];
		str[i][1] = tmp[1];
		str[i][2] = tmp[2];
	}
	int ans = dp(h, h, h);
	printf("%d\n", ans);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:84:9: error: 'memset' was not declared in this scope
   84 |         memset(memo,0xFF,sizeof(memo));
      |         ^~~~~~
a.cc:20:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   19 | #include <queue>
  +++ |+#include <cstring>
   20 | using namespace std;
Language: C++

#include <cstdint>
#include <cstdio>
#include <cmath>
#include <vector>
#include <iostream>
#include <algorithm>
#include <cassert>
#include <stack>
#include <set>
#include <sstream>
using namespace std;
 
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef long long Long;

int MAT[310][310];
int mem[310][310];
int CH[310][310];
int dp(int i,int j,int N){
	if(i==N || j==N)return 0;
	if(mem[i][j] != -1)return mem[i][j];
	int p1 = dp(i+1,j,N);
	int p2 = dp(i,j+1,N);
	if(p1 <= p2){
		CH[i][j] = 0;
	}else{
		CH[i][j] = 1;
	}
	return mem[i][j] = MAT[i][j] + min(p1,p2);
}
int solve2(string A,string B){
	int N = A.size();
	for(int i = N-1; i >= 0; --i){
		for(int j = N-1; j >= 0; --j){
			int s = A[i] == B[j];
			if(i+1 < N && j+1 < N)
				s += MAT[i+1][j+1];
			MAT[i][j] = s;
		}
	}
	memset(mem,-1,sizeof(mem));
	int t = dp(0,0,N);
//	cout << A << endl;
//	cout << B << endl;
//	{
//		int i = 0, j = 0;
//		while(i<N && j<N){
//			int c = CH[i][j];
//			int a = MAT[i][j];
//			if(c == 0){
//				A = " " + A.substr(0,A.size()-1);
//				i++;
//			}else{
//				B = " " + B.substr(0,B.size()-1);
//				j++;
//			}
//			cout << endl;
//			cout << a << endl;
//			cout << A << endl;
//			cout << B << endl;
//		}
//		cout << t << endl;
//		cout << endl;
//	}
	return t;
}

int solve(string A, string B){
	cout << A << " " << B << endl;
	int H = A.size();
	int st = 0;
	int mi = 1000000000;
	for(int j = 0; j < H; ++j){
		int f = 0 , s = 0, nst = 0;
		for(int k = 0; k+j < H; ++k){
			if(A[k] == B[j+k]){
				nst++;
				f += (H-(k+j));
			}
		}
		for(int k = 0; k+j < H; ++k){
			if(j+k == 0)continue;
			if(A[k] == B[j+k-1]){
				s += (H-(k+j));
			}
		}
		mi = min(mi, st+f+s);
		cout << "\t" << (st+f+s) <<"\t" << st << " " << f << " " << s << endl;
		st += nst;
	}
	cout << "\t" << st << endl;
	mi = min(mi, st);
	cout << mi << endl;
	return mi;
}

int main()
{
	int H,W;
	cin >> H >> W;
	vector<string> V(H);
	for (int i = 0; i < H; ++i) {
		cin >> V[i];
	}
	int s = 0;
	for (int i = 1; i < W; ++i) {
		string A,B;
		for (int j = 0; j < H; ++j) {
			A += V[j][i-1];
			B += V[j][i];
		}
		s += solve2(A,B);
	}
	cout << s << endl;
	
	
}
/*
   ]
xcccccx
xcxxxcx





 */



Compiler output:
a.cc: In function 'int solve2(std::string, std::string)':
a.cc:42:9: error: 'memset' was not declared in this scope
   42 |         memset(mem,-1,sizeof(mem));
      |         ^~~~~~
a.cc:11:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   10 | #include <sstream>
  +++ |+#include <cstring>
   11 | using namespace std;
Language: C++

#include <bits/stdc++.h>
using namespace std;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef pair<int, int> pii;
typedef long long ll;
typedef unsigned long long ull;

#define all(a)  (a).begin(),(a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define pb push_back
#define mp make_pair
#define loop(i,a,b) for(ull i=(a);i<ull(b);++i)
#define rep(i,n) loop(i,0,n)
#define iter(i,c) for(auto i=(c).begin(); i!=(c).end(); ++i)
#define riter(i,c) for(auto i=(c).rbegin(); i!=(c).rend(); ++i)

const double eps = 1e-10;
const double pi  = acos(-1.0);
const double inf = (int)1e8;

#define clr(a,i) memset((a), (i) ,sizeof(a))



int main(){
  int h,w;
  std::cin >> h >> w;
  std::vector<std::vector<char>> c(h, vector<char>(w));
  string s;
  rep(i,h){
    std::cin >> s;
    rep(j,w){
      c[i][j]=s[j];
    }
  }
  long ans=0;
  vi t(3,0);
  rep(j,3*h){
    std::vector<long> tmp(3,0);    
    rep(i,h){
      if(c[i+t[0]][0]==c[i+1+t[1]][1]) tmp[0]++;
      if(c[i+1+t[0]][0]==c[i+t[1]][1]) tmp[1]++;
      if(c[i+1+t[2]][2]==c[i+t[1]][1]) tmp[1]++;
      if(c[i+t[2]][2]==c[i+1+t[1]][1]) tmp[2]++;
    }
    rep(i,3){
      if(t[i]==h) t[i]=inf;
    }
    long mi=min(tmp[0],min(tmp[1],tmp[2]));
    if(ma==tmp[0]){
      t[0]++;
      if(c[i+t[0]][0]==c[i+1+t[1]][1]) ans++;
    }else if(ma==tmp[1]){
      t[1]++;
      if(c[i+1+t[0]][0]==c[i+t[1]][1]) ans++;
      if(c[i+1+t[2]][2]==c[i+t[1]][1]) ans++;
    }else if(ma==tmp[2]){
      t[2]++;
      if(c[i+t[2]][2]==c[i+t[1]][1]) ans++;
    }

    
  }
  std::cout << ans << std::endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:55:8: error: 'ma' was not declared in this scope; did you mean 'mi'?
   55 |     if(ma==tmp[0]){
      |        ^~
      |        mi
a.cc:57:12: error: 'i' was not declared in this scope; did you mean 'mi'?
   57 |       if(c[i+t[0]][0]==c[i+1+t[1]][1]) ans++;
      |            ^
      |            mi
a.cc:60:12: error: 'i' was not declared in this scope; did you mean 'mi'?
   60 |       if(c[i+1+t[0]][0]==c[i+t[1]][1]) ans++;
      |            ^
      |            mi
a.cc:61:12: error: 'i' was not declared in this scope; did you mean 'mi'?
   61 |       if(c[i+1+t[2]][2]==c[i+t[1]][1]) ans++;
      |            ^
      |            mi
a.cc:64:12: error: 'i' was not declared in this scope; did you mean 'mi'?
   64 |       if(c[i+t[2]][2]==c[i+t[1]][1]) ans++;
      |            ^
      |            mi
Language: C++

#include <bits/stdc++.h>
typedef long long LL;
#define SORT(c) sort((c).begin(),(c).end())
 
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
 
using namespace std;
int h,w;
vector<string> f;
int cost[310][310][310];
int frmemo[310][310][310];
int fr(int d,int l,int r){
  int he=h-max(l,r);
  if(he==0) return 0;
  if(frmemo[d][l][r]!=-1) return frmemo[d][l][r];
  if(f[h-l-1][d]==f[h-r-1][d+1]) frmemo[d][l][r]=fr(d,l+1,r+1)+1
  else frmemo[d][l][r]=fr(d,l+1,r+1);
  return frmemo[d][l][r];
}
int solve(int d,int l,int r)
{ 
  int he=h-max(l,r);
  if(he==0) return 0;
  if(cost[d][l][r]!=-1) return cost[d][l][r];
  cost[d][l][r]=fr(d,l,r)+min(solve(d,l+1,r),solve(d,l,r+1));
  return cost[d][l][r];
}
int main(void)
{
  cin >> h >> w;
  f.resize(h);
  REP(i,h) cin >> f[i];
  REP(i,310) REP(j,310)REP(k,310) cost[i][j][k]=-1;
  REP(i,310) REP(j,310)REP(k,310) frmemo[i][j][k]=-1;
  int answer=0;
  REP(i,w-1) answer+=solve(i,0,0);
  cout << answer << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int fr(int, int, int)':
a.cc:17:65: error: expected ';' before 'else'
   17 |   if(f[h-l-1][d]==f[h-r-1][d+1]) frmemo[d][l][r]=fr(d,l+1,r+1)+1
      |                                                                 ^
      |                                                                 ;
   18 |   else frmemo[d][l][r]=fr(d,l+1,r+1);
      |   ~~~~
Language: C++

#include <bits/stdc++.h>
typedef long long LL;
#define SORT(c) sort((c).begin(),(c).end())
 
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
 
using namespace std;
int h,w;
vector<string> f;
int cost[310][310][310];
int frmemo[310][310][310];
int fr(int d,int l,int r){
  int he=h-max(l,r);
  if(he==0) return 0;
  if(frmemo[d][l][r]!=-1) return frmemo[d][l][r];
  if(f[h-l-1][d]==f[h-r-1][d+1]) frmemo[d][l][r]=fr(d,l+1,r+1)+1
  else frmemo[d][l][r]=fr(d,l+1,r+1);
  return frmemo;
}
int solve(int d,int l,int r)
{ 
  int he=h-max(l,r);
  if(he==0) return 0;
  if(cost[d][l][r]!=-1) return cost[d][l][r];
  cost[d][l][r]=fr(d,l,r)+min(solve(d,l+1,r),solve(d,l,r+1));
  return cost[d][l][r];
}
int main(void)
{
  cin >> h >> w;
  f.resize(h);
  REP(i,h) cin >> f[i];
  REP(i,310) REP(j,310)REP(k,310) cost[i][j][k]=-1;
  REP(i,310) REP(j,310)REP(k,310) frmemo[i][j][k]=-1;
  int answer=0;
  REP(i,w-1) answer+=solve(i,0,0);
  cout << answer << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int fr(int, int, int)':
a.cc:17:65: error: expected ';' before 'else'
   17 |   if(f[h-l-1][d]==f[h-r-1][d+1]) frmemo[d][l][r]=fr(d,l+1,r+1)+1
      |                                                                 ^
      |                                                                 ;
   18 |   else frmemo[d][l][r]=fr(d,l+1,r+1);
      |   ~~~~                                                           
a.cc:19:10: error: invalid conversion from 'int (*)[310][310]' to 'int' [-fpermissive]
   19 |   return frmemo;
      |          ^~~~~~
      |          |
      |          int (*)[310][310]
Language: C++

#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<math.h>
#include<map>
#include<iterator>
#include<set>
#include<queue>

#define rep(i,n) for(int i = 0; i < n; i++)

using namespace std;

int countx(int i, string s1, int j, string s2){
	int res = 0;
	for(int k = 0; k !=  std::min(s1.size() - i, s2.size() - j); k++){
		if(s1[s1.size() - k - i - 1] == s2[s2.size() - k - j - 1])
			res++;
	}
	return res;
}


int main(){
	int h,w; cin >> h >> w;
	/*
	vector<vector<char>> c;
	rep(i,h){
		vector<int> temp;
		rep(j,w){
			int temp2;
			cin >> temp2;
			temp.push_back(temp2);
		}
		c.push_back(temp);
	}*/
	string c1,c2,c3;
	if(w == 3){
		rep(i,h){
			char k,l,z; cin >> k >> l >> z;
			c1.push_back(k); c2.push_back(l); c3.push_back(z);
		}
	}
	if(w == 2){
		rep(i,h){
			char k,l; cin >> k >> l;
			c1.push_back(k); c2.push_back(l); c3.push_back('-');
		}
	}
	if(w == 1){
		cout << 0 << endl;
		return 0;
	}

	int ans[300][300][300];
	for(int i = h; i != -1; i--){
		for(int j = h; j != -1;j--){
			for(int k = h; k != -1; k--){
				if(j == h)
					ans[i][j][k] = 0;
				else if(i == h && k == h)
					ans[i][j][k] = 0;
				else if(i == h)
					ans[i][j][k] = std::min(ans[i][j+1][k], ans[i][j][k+1]) + countx(j,c2,k,c3);
				else if(k == h)
					ans[i][j][k] = std::min(ans[i+1][j][k], ans[i][j+1][k]) + countx(i,c1,j,c2);
				else{
					ans[i][j][k] = std::min(ans[i+1][j][k] + countx(i,c1,j,c2), ans[i][j+1][k] + countx(i,c1,j,c2) + countx(j,c2,k,c3), ans[i][j][k+1] + countx(j,c2,k,c3));
				}
			}
		}
	}
	cout << ans[0][0][0] << endl;
}

Compiler output:
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:69:29:   required from here
   69 |                                         ans[i][j][k] = std::min(ans[i+1][j][k] + countx(i,c1,j,c2), ans[i][j+1][k] + countx(i,c1,j,c2) + countx(j,c2,k,c3), ans[i][j][k+1] + countx(j,c2,k,c3));
      |                                                        ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:284:17: error: '__comp' cannot be used as a function
  284 |       if (__comp(__b, __a))
      |           ~~~~~~^~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
#define cadd(_x,_y) _x = add(_x, _y)
#define cpop(_x,_y) _x = pop(_x, _y)
#define cmul(_x,_y) _x = mul(_x, _y)
const int mod = 1e9 + 7;
inline int add(int a, int b) {a += b; return a >= mod ? a - mod : a;}
inline int pop(int a, int b) {a -= b; return a < 0 ? a + mod : a;}
inline int mul(int a, int b) {return (long long)a * b % mod;}
int qpow(int a, int b)  {
	int c = 1;
	while (b) {
		if (b & 1) cmul(c, a);	
		b >>= 1; cmul(a, a);
	}
	return c;
}
int n, a [ 300005 ] , fac [ 300005 ] = { 1 } ;
int c [ 300005 ] ;
void cg(int o, int v) {
	for (int i = o; i <= n; i += i & - i )
		c[i] += v;
}
int get(int o) {
	int sum = 0;
	for (int i = o; i >= 1; i -= i & - i )
		sum += c[i];
	return sum;
}
int c2(int m) {
	return (long long)m * (m - 1) / 2 % mod;
}
int suf[300005], pre[300005];
int main() {
	scanf("%d", &n);	
	for ( int i = 1 ; i <= n ; i ++ ) scanf("%d", &a[i]);
	for ( int i = 1 ; i <= n ; i ++ ) fac[i] = i * fac [ i - 1 ] % ( 1e9 + 3 ) ;
	int ans = 0, cur = 0, all = 0, cof = 0, bs = 0;
	for ( int i = 1 ; i <= n ; i ++ ) all += a[i] == 0, cadd(bs, i - 1), pre[i] = 1, suf[i] = 1;
	for ( int i = 1 ; i <= n ; i ++ ) if (a[i] != 0) cpop(bs, a[i] - 1);
	for ( int i = 1 ; i <= n ; i ++ ) if (a[i] > 0) suf[a[i]] = 0, pre[a[i]] = 0;
	for ( int i = n ; i >= 1 ; i -- ) suf[i] += suf[i + 1];
	for ( int i = 1 ; i <= n ; i ++ ) pre[i] += pre[i - 1];
	for ( int i = 1 ; i <= n ; i ++ ) {
		int sum = 0;
		cur += a[i] == 0;
		if (a[i] != 0) {
			cadd(sum, mul(fac[all], a[i] - 1));
			int w = get(a[i] - 1);
			cpop(sum, mul(fac[all], w));
			if (all > 0) cpop(sum, mul(pre[a[i]], mul(cur, fac[all - 1])));
			cadd(cof, suf[a[i]]);
			cg(a[i], 1);
		} else {
			if (all > 0) cadd(sum, mul(bs, fac[all - 1]));
			if (cur >= 2) cpop(sum, mul(c2(all), mul(cur - 1, fac[all - 2])));
			if (all > 0) cpop(sum, mul(cof, fac[all - 1]));
		}
		cadd(ans, mul(sum, fac[n - i]));
	}
	printf("%d\n", add(ans, fac[all]));
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:70: error: invalid operands of types 'int' and 'double' to binary 'operator%'
   36 |         for ( int i = 1 ; i <= n ; i ++ ) fac[i] = i * fac [ i - 1 ] % ( 1e9 + 3 ) ;
      |                                                    ~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~
      |                                                      |                       |
      |                                                      int                     double
Language: Java

import java.util.*;

public class Main {
  private static boolean elapsed = false;

  private static long sum;
  private static int cnt;

  public static void main(String[] args) {
    long S = System.currentTimeMillis();

    Scanner sc = new Scanner(System.in);

    int N = sc.nextInt();
    int[] P = new int[N];
    for (int i = 0; i < P.length; ++i) {
      P[i] = sc.nextInt();
    }

    long div = (long)Math.pow(10, 9) + 7;
    solve(P);
    System.out.println(sum % div);

    long G = System.currentTimeMillis();
    if (elapsed) {
      System.err.println((G - S) + "ms");
    }
  }
  private static void solve(int[] P) {
    List<Integer> list = new ArrayList<>(P.length);
    for (int i = 0; i < P.length; ++i) {
      list.add(i + 1);
    }
    search(list, 0, new ArrayList<>(), P);
  }
  private static void search(List<Integer> list, int d, List<Integer> p, int[] P) {
    if (d >= list.size()) {
      ++cnt;
      if (match(P, p)) {
        sum += cnt;
        sum %= div;
      }
    } else {
      for (int i = 0; i < list.size(); ++i) {
        int num = list.get(i);
        if (p.contains(num)) {
          continue;
        }
        p.add(num);
        search(list, d + 1, p, P);
        p.remove(p.size() - 1);
      }
    }
  }
  private static boolean match(int[] P, List<Integer> list) {
    for (int i = 0; i < P.length; ++i) {
      if (P[i] > 0) {
        if (list.get(i) != P[i]) {
          return false;
        }
      }
    }
    return true;
  }
}

Compiler output:
Main.java:41: error: cannot find symbol
        sum %= div;
               ^
  symbol:   variable div
  location: class Main
1 error
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
#define repp(i, m, n) for(int i = m; i < n; i++)
const int    INF = 100000000;
const double EPS = 1e-10;
const int    MOD = 1000000007;
using namespace std;
typedef long long ll;
typedef pair<int, int> pai;
typedef pair<ll,ll> pal;
int n;
int k=0;
int p[3010];
int lef[3010]={};
int deru[3010]={};
int dezu[3010];
int big[3010]={};
int kosu[3010]={};
ll mae;
ll kazu;
ll sum;
ll ans=0;
int main()
{
	cin >> n;
	rep(i, n)
	{
		cin >> p[i];
		if(p[i]!=0)
		{
			deru[p[i]-1]=1;
			lef[i+1]=left[i];
		}
		else
		{
			lef[i+1]=left[i]+1;
		}
	}
	rep(i, n)
	{
		if(deru[i]==0)
		{
			dezu[k]=i;
			k++;
		}
	}
	rep(i, n)
	{
		if(deru[n-1-i]==0)
		{
			big[n-1-i]=big[n-i]+1;
		}
	}
	mae=1;
	repp(i, 1, k)
	{
		mae*=i;
		mae%=MOD;
	}
	kazu=(mae*k)%MOD;
	sum=(kazu*(kazu+1))%MOD;
	sum=(sum*500000004)%MOD;
	rep(i, n)
	{
		if(p[i]!=0)
		{
			rep(j, i)
			{
				if(p[i]<p[j])
				{
					kosu[i]++;
				}
			}
			ans+=(kosu[i]*kazu);
			ans+=(((big[p[i]-1]*lef[i])%MOD)*mae)%MOD;
		}
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:40: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   32 |                         lef[i+1]=left[i];
      |                                        ^
a.cc:32:40: error: invalid conversion from 'std::ios_base& (*)(std::ios_base&)' to 'int' [-fpermissive]
   32 |                         lef[i+1]=left[i];
      |                                  ~~~~~~^
      |                                        |
      |                                        std::ios_base& (*)(std::ios_base&)
a.cc:36:40: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   36 |                         lef[i+1]=left[i]+1;
      |                                        ^
a.cc:36:41: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   36 |                         lef[i+1]=left[i]+1;
      |                                  ~~~~~~~^~
a.cc:36:41: error: invalid conversion from 'std::ios_base& (*)(std::ios_base&)' to 'int' [-fpermissive]
   36 |                         lef[i+1]=left[i]+1;
      |                                  ~~~~~~~^~
      |                                         |
      |                                         std::ios_base& (*)(std::ios_base&)
Language: C++

import Control.Monad
import Control.Applicative
import Data.List

taka :: [Int] -> Int
taka xs = sum $ map (\x -> ponya (permutation $ [1..(length xs)]) x 1)  (p5 ( length xs ) xs (kuwa xs 1)) 

ponya :: [[Int]] -> [Int] -> Int -> Int
ponya (x:xs) y n
    | x == y = n
    | x /= y = ponya xs y (n+1)

p5 :: Int -> [Int] -> [Int] -> [[Int]]
p5 _ [] _ = [[]]
p5 n (x:xs) ys
    | x == 0 = do
        x <- ys
        map (x:) (p5 n xs ( delete x ys ))
    | x /= 0 = do
        map (x:) (p5 n xs ys)

kuwa :: [Int] -> Int -> [Int]
kuwa [] _ = []
kuwa (x:xs) n
    | x == 0 = (n:) (kuwa xs (n+1))
    | x /= 0 = kuwa xs (n+1)

permutation :: Eq a => [a] -> [[a]]
permutation [] = [[]]
permutation xs = do
    x <- xs
    map (x:) (permutation $ delete x xs)

main = do
    n' <- getLine
    p' <- getLine
    print $ taka $ map (\x -> (read x :: Int)) (words p')

Compiler output:
a.cc:6:22: error: stray '\' in program
    6 | taka xs = sum $ map (\x -> ponya (permutation $ [1..(length xs)]) x 1)  (p5 ( length xs ) xs (kuwa xs 1))
      |                      ^
a.cc:6:50: error: too many decimal points in number
    6 | taka xs = sum $ map (\x -> ponya (permutation $ [1..(length xs)]) x 1)  (p5 ( length xs ) xs (kuwa xs 1))
      |                                                  ^~~
a.cc:35:6: warning: missing terminating ' character
   35 |     n' <- getLine
      |      ^
a.cc:35:6: error: missing terminating ' character
   35 |     n' <- getLine
      |      ^~~~~~~~~~~~
a.cc:36:6: warning: missing terminating ' character
   36 |     p' <- getLine
      |      ^
a.cc:36:6: error: missing terminating ' character
   36 |     p' <- getLine
      |      ^~~~~~~~~~~~
a.cc:37:25: error: stray '\' in program
   37 |     print $ taka $ map (\x -> (read x :: Int)) (words p')
      |                         ^
a.cc:37:56: warning: missing terminating ' character
   37 |     print $ taka $ map (\x -> (read x :: Int)) (words p')
      |                                                        ^
a.cc:37:56: error: missing terminating ' character
   37 |     print $ taka $ map (\x -> (read x :: Int)) (words p')
      |                                                        ^~
a.cc:1:1: error: 'import' does not name a type
    1 | import Control.Monad
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include<stdio.h>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<algorithm>
#include<cmath>
#include<bitset>
 
#define Vsort(a) sort(a.begin(), a.end())
#define Vreverse(a) reverse(a.begin(), a.end())
#define Srep(n) for(int i = 0; i < (n); i++)
#define Lrep(i,a,n) for(int i = (a); i < (n); i++)
#define Brep(n) for(int bit = 0; bit < (1<<n); bit++)
#define rep2nd(n,m) Srep(n) Lrep(j,0,m)
#define vi vector<int>
#define vi64 vector<int64_t>
#define vvi vector<vector<int>>
#define vvi64 vector<vector<int64_t>>
#define P pair<int,int>
#define F first
#define S second
 
using namespace std;

int main(){
  int input;
  set<int> st;
  Srep(3){
    cin >> input;
    st.insert(input);
  }
  cout << st.size() << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:3: error: 'set' was not declared in this scope
   28 |   set<int> st;
      |   ^~~
a.cc:9:1: note: 'std::set' is defined in header '<set>'; this is probably fixable by adding '#include <set>'
    8 | #include<bitset>
  +++ |+#include <set>
    9 | 
a.cc:28:7: error: expected primary-expression before 'int'
   28 |   set<int> st;
      |       ^~~
a.cc:31:5: error: 'st' was not declared in this scope; did you mean 'std'?
   31 |     st.insert(input);
      |     ^~
      |     std
a.cc:33:11: error: 'st' was not declared in this scope; did you mean 'std'?
   33 |   cout << st.size() << endl;
      |           ^~
      |           std
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int a,b,c;
 cin >> a >> b >> c;

if(a==b&&b==c){cout<<1<<endl;}
else if(a!=b&&b!&&c||c!=a){cout<<3<<endl;}
else {cout<<2<<endl;}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:16: error: expected ')' before '!' token
    9 | else if(a!=b&&b!&&c||c!=a){cout<<3<<endl;}
      |        ~       ^
      |                )
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int a,b,c;
 cin >> a >> b >> c;

if(a==b&&b==c){cout<<1<<endl;}
else if(a!==b||b!==C||c!==a){cout<<3<<endl;}
else {cout<<2<<endl;}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: expected primary-expression before '=' token
    9 | else if(a!==b||b!==C||c!==a){cout<<3<<endl;}
      |            ^
a.cc:9:19: error: expected primary-expression before '=' token
    9 | else if(a!==b||b!==C||c!==a){cout<<3<<endl;}
      |                   ^
a.cc:9:20: error: 'C' was not declared in this scope
    9 | else if(a!==b||b!==C||c!==a){cout<<3<<endl;}
      |                    ^
a.cc:9:26: error: expected primary-expression before '=' token
    9 | else if(a!==b||b!==C||c!==a){cout<<3<<endl;}
      |                          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int a,b,c;
 cin >> a >> b >> c;

if(a==b&&b==c){cout<<1<<endl;}
else if!(a==b||b==C||c==a){cout<<3<<endl;}
else {cout<<2<<endl;}
}
//表

Compiler output:
a.cc: In function 'int main()':
a.cc:9:8: error: expected '(' before '!' token
    9 | else if!(a==b||b==C||c==a){cout<<3<<endl;}
      |        ^
      |        (
a.cc:10:1: error: 'else' without a previous 'if'
   10 | else {cout<<2<<endl;}
      | ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int a,b,c;
 cin >> a >> b >> c;

if(a=b&&b=c){cout<<1<<endl;}

}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: lvalue required as left operand of assignment
    8 | if(a=b&&b=c){cout<<1<<endl;}
      |      ~^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int a,b,c;
 cin >> a >> b >> c;

if(a=b&&b=c){cout<<1<<endl;}
if!(a=b||b=c||c=a){cout<<3<<endl;}
cout << 2<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: lvalue required as left operand of assignment
    8 | if(a=b&&b=c){cout<<1<<endl;}
      |      ~^~~
a.cc:9:3: error: expected '(' before '!' token
    9 | if!(a=b||b=c||c=a){cout<<3<<endl;}
      |   ^
      |   (
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1e16;
const ll mod = 1000000007;
#define rep(i, n) for (int i = 0; i < (ll)(n); i++)

int main() {
    vector <ll> v(3);
    rep(i, 3) cin >> v.at(i);
    sort(v.begin(), v.end())
    ll res = 1;
    rep(i, 2) {
        if (v.at(i) != v.at(i+1)) res++;
    }
    cout << res << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:29: error: expected ';' before 'll'
   11 |     sort(v.begin(), v.end())
      |                             ^
      |                             ;
   12 |     ll res = 1;
      |     ~~                       
a.cc:14:35: error: 'res' was not declared in this scope; did you mean 'rep'?
   14 |         if (v.at(i) != v.at(i+1)) res++;
      |                                   ^~~
      |                                   rep
a.cc:16:13: error: 'res' was not declared in this scope; did you mean 'rep'?
   16 |     cout << res << endl;
      |             ^~~
      |             rep
Language: C++

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

int main () {
  set<int> s;

  for (int i=0;i<3;i++) {
    int a; cin >> a;
    s.insert(a);
  }
  
  cout << s.count() << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:18: error: no matching function for call to 'std::set<int>::count()'
   13 |   cout << s.count() << endl;
      |           ~~~~~~~^~
In file included from /usr/include/c++/14/set:63,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_set.h:756:9: note: candidate: 'template<class _Kt> decltype (((const std::set<_Key, _Compare, _Alloc>*)this)->std::set<_Key, _Compare, _Alloc>::_M_t._M_count_tr(__x)) std::set<_Key, _Compare, _Alloc>::count(const _Kt&) const [with _Key = int; _Compare = std::less<int>; _Alloc = std::allocator<int>]'
  756 |         count(const _Kt& __x) const
      |         ^~~~~
/usr/include/c++/14/bits/stl_set.h:756:9: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/stl_set.h:750:7: note: candidate: 'std::set<_Key, _Compare, _Alloc>::size_type std::set<_Key, _Compare, _Alloc>::count(const key_type&) const [with _Key = int; _Compare = std::less<int>; _Alloc = std::allocator<int>; size_type = long unsigned int; key_type = int]'
  750 |       count(const key_type& __x) const
      |       ^~~~~
/usr/include/c++/14/bits/stl_set.h:750:7: note:   candidate expects 1 argument, 0 provided
Language: C++

/*
   Author : tarang
*/
#include<bits/stdc++.h>
#define ll long long
#define fastio ios_base::sync_with(false); cin.tie(0);cout.tie(0);
const int MOD = 1000000007;
#define PI = acos(-1)
using namespace std ;
int main(){
	set<int s ;
   int a , b , c;
   cin >> a >> b >> c ;
   s.insert(a);
   s.insert(b);
   s.insert(c);
   cout << s.size() << endl;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: template argument 1 is invalid
   11 |         set<int s ;
      |                 ^
a.cc:11:17: error: template argument 2 is invalid
a.cc:11:17: error: template argument 3 is invalid
a.cc:14:4: error: 's' was not declared in this scope
   14 |    s.insert(a);
      |    ^
Language: C

#includde<stdio.h>

int main(){
  int a,b,c;
  scanf("%d%d%d",&a,&b,&c);
  
  if(a==b){
    if(b==c){
      printf("1\n");
    }else{
      printf("2\n");
    }
  }else{
    if(a==c||b==c){
      printf("2\n");
    }else{
      printf("3\n");
    }
  }
  return 0;
}

Compiler output:
main.c:1:2: error: invalid preprocessing directive #includde; did you mean #include?
    1 | #includde<stdio.h>
      |  ^~~~~~~~
      |  include
main.c: In function 'main':
main.c:5:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    5 |   scanf("%d%d%d",&a,&b,&c);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | #includde<stdio.h>
main.c:5:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    5 |   scanf("%d%d%d",&a,&b,&c);
      |   ^~~~~
main.c:5:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:9:7: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    9 |       printf("1\n");
      |       ^~~~~~
main.c:9:7: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:9:7: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:9:7: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:11:7: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   11 |       printf("2\n");
      |       ^~~~~~
main.c:11:7: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:15:7: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   15 |       printf("2\n");
      |       ^~~~~~
main.c:15:7: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:17:7: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   17 |       printf("3\n");
      |       ^~~~~~
main.c:17:7: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include<stdio.h>
int main(){
  int arr[3];
  int i;
  for(i=0;i<3;i++){
    scanf("%d ",&arr[i]);
  }
  int j,flag=1;count=1;
  for(i=1;i<3;i++){
    for(j=0;j<i;j++){
      if(arr[i]==arr[j]){
        flag=0;
        break;
      }
    }
    if(flag==1) count++;
  }
  printf("%d\n",count);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:16: error: 'count' undeclared (first use in this function)
    8 |   int j,flag=1;count=1;
      |                ^~~~~
main.c:8:16: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
#define rep2(i,a,n) for(int i=(a); i<(n); i++)
#define all(vec) vec.begin(),vec.end()
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
int main() {
  int a, b, c; cin a >> b >> c;
  if (a == b && b == c) cout << 1 << endl;
  else if (a != b && b != c && a != c) cout << 3 << endl;
  else cout << 2 << endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:19: error: expected ';' before 'a'
   11 |   int a, b, c; cin a >> b >> c;
      |                   ^~
      |                   ;
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int A[101];
    for (int i=0 ; i<101 ;I++){
      A[i]=0 ;
    }
  int a ,b , c ;
  cin >> a >> b >> c ;
  A[a] = 1;
  A[b] =1 ;
  A[c]=1;
  int count =0;
  for (int i=0 ; i<101 ;i++){
    if ( A[i]==1){
      count++;
    }
  }
    cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:27: error: 'I' was not declared in this scope
    6 |     for (int i=0 ; i<101 ;I++){
      |                           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int A[101];
    for (int i=0 ; i<101 ;I++){
      A[i]=0 ;
    }
  int a ,b , c ;
  cin >> a >> b >> c ;
  A[a] = 1;
  A[b] =1 ;
  A[c]=1;
  int count =0;
  for (int i=0 ; i<101 ;i++){
    if ( A[i]==1){
      count++
    }
  }
    cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:27: error: 'I' was not declared in this scope
    6 |     for (int i=0 ; i<101 ;I++){
      |                           ^
a.cc:17:14: error: expected ';' before '}' token
   17 |       count++
      |              ^
      |              ;
   18 |     }
      |     ~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int A[101];
    for (int i=0 ; i<101 ;I++){
      A[i]=0 ;
    }
  int a ,b , c ;
  cin >> a >> b >> c ;
  A[a] = 1;
  A[b] =1 ;
  A[c]=1;
  int count =0;
  for (int i=0 ; i<101 ;i++){
    if ( A[i]==1){
      count++
    }
    cout << count << endl;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:6:27: error: 'I' was not declared in this scope
    6 |     for (int i=0 ; i<101 ;I++){
      |                           ^
a.cc:17:14: error: expected ';' before '}' token
   17 |       count++
      |              ^
      |              ;
   18 |     }
      |     ~         
a.cc:20:4: error: expected '}' at end of input
   20 |   }
      |    ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C

include <stdio.h>

int main(void){

  int a, b, c;

  scanf("%d %d %d",&a,&b,&c);

  if(a==b||a==c||b==c){

    if(a==b&&b==c){

      printf("1\n");

    }else{

      printf("2\n");

    }

  }else{

      printf("3\n");

    }

    return 0;

}


Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
Language: C

#include <stdio.h>

int main(void){
        int a,b,c;
        scanf("%d%d%d",&a,&b,&c);

        if(a==b && b==c) printf("1\n");
        else if(a==b && b!=c || b==c a!=b)printf("2\n");
        else printf("3\n");
        return 0;
}


Compiler output:
main.c: In function 'main':
main.c:8:37: error: expected ')' before 'a'
    8 |         else if(a==b && b!=c || b==c a!=b)printf("2\n");
      |                ~                    ^~
      |                                     )
Language: C++

#include <cstdio>

int main()
{
    int a,b,c;
    scanf("%d %d %d", &a, &b, &c);
    if (a == b and a == c)
    {
        printf("3")
    }
    
    else if (a == b or a == c or b == c)
    {
        printf("2")
    }
    
    else 
    {
        printf("1")
    }
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:20: error: expected ';' before '}' token
    9 |         printf("3")
      |                    ^
      |                    ;
   10 |     }
      |     ~               
a.cc:14:20: error: expected ';' before '}' token
   14 |         printf("2")
      |                    ^
      |                    ;
   15 |     }
      |     ~               
a.cc:19:20: error: expected ';' before '}' token
   19 |         printf("1")
      |                    ^
      |                    ;
   20 |     }
      |     ~
Language: C++

#include <cstdio>

int main()
{
    int a,b,c;
    scanf("%d %d %d", &a, &b, &c);
    if (a == b and a == c)
    {
        printf("3")
    }
    
    else if (a == b or a == c or b == c)
    {
        printf("2")
    }
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:20: error: expected ';' before '}' token
    9 |         printf("3")
      |                    ^
      |                    ;
   10 |     }
      |     ~               
a.cc:14:20: error: expected ';' before '}' token
   14 |         printf("2")
      |                    ^
      |                    ;
   15 |     }
      |     ~
Language: Java

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String[] in = sc.nextString().split(" ");
        List<Integer> list = new ArrayList<>();
        for(String s : in){
            int i = Integer.parseInt(s);
            if(!list.contains(i))
                list.add(i);
        }
        System.out.println(list.length());
    }
}

Compiler output:
Main.java:6: error: cannot find symbol
        String[] in = sc.nextString().split(" ");
                        ^
  symbol:   method nextString()
  location: variable sc of type Scanner
Main.java:13: error: cannot find symbol
        System.out.println(list.length());
                               ^
  symbol:   method length()
  location: variable list of type List<Integer>
2 errors
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    System.out.println(Arrays.stream(scanner.nextLine().split(" ")).collect(Collectors.toSet()).size());
  }
}


Compiler output:
Main.java:6: error: cannot find symbol
    System.out.println(Arrays.stream(scanner.nextLine().split(" ")).collect(Collectors.toSet()).size());
                                                                            ^
  symbol:   variable Collectors
  location: class Main
1 error