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

#include <cstdio>
#include <cstring>
#include <algorithm>

typedef long long LL;
char str[2][50010];
int l[2],sz[2],len[2][50010],cnt[2][50010],son[2][50010][30],fail[2][50010];
LL ans;
void addnode(int l,int k);
void build(int k);
void dfs(int u,int v);

int main()
{
    int i,j;
    for(i=0;i<=1;i++)
    {
        gets(str[i]);
        l[i]=strlen(str[i]);
        for(j=l[i];j>=1;j--)
            str[i][j]=str[i][j-1];
        build(i);
    }
    ans=0;
    dfs(1,1);  dfs(2,2);
    printf("%lld\n",ans);
    return 0;
}

void addnode(int l,int k)
{
    sz[k]++;
    len[k][sz[k]]=l;  cnt[k][sz[k]]=0;
}

void build(int k)
{
    sz[k]=0;
    addnode(-1,k);  addnode(0,k);
    fail[k][sz[k]-1]=fail[k][sz[k]]=sz[k]-1;
    int i,u,x;
    for(u=1,i=1;i<=l[k];i++)
    {
        while(i-len[k][u]-1<1 || str[k][i-len[k][u]-1]!=str[k][i]) u=fail[k][u];
        x=str[k][i]-'A';
        if(!son[k][u][x])
        {
            addnode(len[k][u]+2,k);
            int v=fail[k][u];
            while(i-len[k][v]-1<1 || str[k][i-len[k][v]-1]!=str[k][i]) v=fail[k][v];
            fail[k][sz[k]]=(son[k][v][x] ? son[k][v][x] : 2);
            son[k][u][x]=sz[k];
        }
        cnt[k][son[k][u][x]]++;
        u=son[k][u][x];
    }
    for(i=sz[k];i>3;i--)
        cnt[k][fail[k][i]]+=cnt[k][i];
}

void dfs(int u,int v)
{
    if(len[0][u]>0)
        ans+=(LL)cnt[0][u]*cnt[1][v];
    int i;
    for(i=0;i<26;i++)
        if(son[0][u][i] && son[1][v][i])
            dfs(son[0][u][i],son[1][v][i]);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
   18 |         gets(str[i]);
      |         ^~~~
      |         getw
Language: C++

#include<iostream>
#include<vector>
#include<set>
#include<algorithm>
using namespace std;
typedef long long int integer;

struct edge {
  integer to, cap, rev;
};

const integer VMAX = 6000, INF = 1e10;

vector<edge> G[VMAX];
bool used[VMAX];

void add_edge(integer from, integer to, integer cap) {
  G[from].push_back((edge) {to, cap, (integer)G[to].size()});
  G[to].push_back((edge) {from, 0, (integer)G[from].size()-1});
}

integer dfs(integer v, integer t, integer f) {
  if (v == t) return f;
  used[v] = true;
  for (int i = 0, size = G[v].size(); i < size; i++) {
    edge &e = G[v][i];
    if (!used[e.to] && e.cap > 0) {
      integer d = dfs(e.to, t, min(f, e.cap));
      if (d > 0) {
        e.cap -= d;
        G[e.to][e.rev].cap += d;
        return d;
      }
    }
  }
  return 0;
}

integer max_flow(integer s, integer t) {
  integer flow = 0;
  while (true) {
    for (int i = 0; i < VMAX; i++) {
      used[i] = false;
    }
    integer f = dfs(s, t, INF);
    if (f == 0) return flow;
    flow += f;
  }
}

integer gcd(integer a, integer b) {
  return (b == 0 ? a : gcd(b, a % b));
}

int main() {
  int N;
  cin >> N;
  const int SEPARATOR = 3010,
        SOURCE = 3008, SINK = 3009;
  vector<integer> A(N), B(N);
  set<integer> width_set;
  for (int i = 0; i < N; i++) {
    cin >> A[i] >> B[i];
    width_set.insert(A[i]);
    width_set.insert(B[i]);
  }

  vector<int> ws;
  
  for (int i = 0; i < N; i++) {
    int a_idx = find(ws.begin(), ws.end(), A[i]) - ws.begin();
    int b_idx = find(ws.begin(), ws.end(), B[i]) - ws.begin();
    add_edge(SOURCE, a_idx, A[i]);
    add_edge(SOURCE, b_idx, B[i]);
    add_edge(SEPARATOR + i, 
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:76:3: error: expected primary-expression before '}' token
   76 |   }
      |   ^
Language: C++

#include
#define f first
#define s second 
using namespace std;
typedef pair p;
typedef pair P;
int n,used[1000],ans,w;
P c[2000];
int main(){
 cin>>n;
 for(int i=0,a,b;i<n;i++)
cin>>a>>b,c[i*2]=P(p(a,-b),i),c[i*2+1]=P(p(b,-a),i);
 sort(c,c+2*n); for(int i=0;i<2*n;i++) if(!used[c[i].s]&&c[i].f.f>w) used[c[i].s]=1,ans+=-c[i].f.s,w=c[i].f.f; cout<<ans<<endl;
return 0;
} 

Compiler output:
a.cc:1:9: error: #include expects "FILENAME" or <FILENAME>
    1 | #include
      |         ^
a.cc:5:9: error: 'pair' does not name a type
    5 | typedef pair p;
      |         ^~~~
a.cc:6:9: error: 'pair' does not name a type
    6 | typedef pair P;
      |         ^~~~
a.cc:8:1: error: 'P' does not name a type
    8 | P c[2000];
      | ^
a.cc: In function 'int main()':
a.cc:10:2: error: 'cin' was not declared in this scope
   10 |  cin>>n;
      |  ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #include
a.cc:12:11: error: 'c' was not declared in this scope
   12 | cin>>a>>b,c[i*2]=P(p(a,-b),i),c[i*2+1]=P(p(b,-a),i);
      |           ^
a.cc:12:20: error: 'p' was not declared in this scope
   12 | cin>>a>>b,c[i*2]=P(p(a,-b),i),c[i*2+1]=P(p(b,-a),i);
      |                    ^
a.cc:12:18: error: 'P' was not declared in this scope
   12 | cin>>a>>b,c[i*2]=P(p(a,-b),i),c[i*2+1]=P(p(b,-a),i);
      |                  ^
a.cc:13:7: error: 'c' was not declared in this scope
   13 |  sort(c,c+2*n); for(int i=0;i<2*n;i++) if(!used[c[i].s]&&c[i].f.f>w) used[c[i].s]=1,ans+=-c[i].f.s,w=c[i].f.f; cout<<ans<<endl;
      |       ^
a.cc:13:2: error: 'sort' was not declared in this scope; did you mean 'short'?
   13 |  sort(c,c+2*n); for(int i=0;i<2*n;i++) if(!used[c[i].s]&&c[i].f.f>w) used[c[i].s]=1,ans+=-c[i].f.s,w=c[i].f.f; cout<<ans<<endl;
      |  ^~~~
      |  short
a.cc:13:112: error: 'cout' was not declared in this scope
   13 |  sort(c,c+2*n); for(int i=0;i<2*n;i++) if(!used[c[i].s]&&c[i].f.f>w) used[c[i].s]=1,ans+=-c[i].f.s,w=c[i].f.f; cout<<ans<<endl;
      |                                                                                                                ^~~~
a.cc:13:112: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:13:123: error: 'endl' was not declared in this scope
   13 |  sort(c,c+2*n); for(int i=0;i<2*n;i++) if(!used[c[i].s]&&c[i].f.f>w) used[c[i].s]=1,ans+=-c[i].f.s,w=c[i].f.f; cout<<ans<<endl;
      |                                                                                                                           ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #include
Language: C++

#include<bits/stdc++.h>
#define f first
#define s second 
using namespace std;
typedef pair p;
typedef pair P;
int n,used[1000],ans,w;
P c[2000];
int main(){
 cin>>n;
 for(int i=0,a,b;i<n;i++)
cin>>a>>b,c[i*2]=P(p(a,-b),i),c[i*2+1]=P(p(b,-a),i);
 sort(c,c+2*n); for(int i=0;i<2*n;i++) if(!used[c[i].s]&&c[i].f.f>w) used[c[i].s]=1,ans+=-c[i].f.s,w=c[i].f.f; cout<<ans<<endl;
return 0;
} 

Compiler output:
a.cc:5:9: error: typedef declared 'auto'
    5 | typedef pair p;
      |         ^~~~
a.cc:6:9: error: typedef declared 'auto'
    6 | typedef pair P;
      |         ^~~~
a.cc: In function 'int main()':
a.cc:12:11: error: 'c' was not declared in this scope
   12 | cin>>a>>b,c[i*2]=P(p(a,-b),i),c[i*2+1]=P(p(b,-a),i);
      |           ^
a.cc:13:7: error: 'c' was not declared in this scope
   13 |  sort(c,c+2*n); for(int i=0;i<2*n;i++) if(!used[c[i].s]&&c[i].f.f>w) used[c[i].s]=1,ans+=-c[i].f.s,w=c[i].f.f; cout<<ans<<endl;
      |       ^
Language: Java

import java.util.Arrays;
import java.util.Scanner;

public class F {
	static Scanner sc = new Scanner(System.in);
	static int N;

	public static void main(String[] args) throws Exception {
		N = sc.nextInt();
		int[] a = new int[N];
		for (int i = 0; i < N; ++i) {
			a[i] = sc.nextInt();
		}
		Arrays.sort(a);
		int cur = 0;
		while (cur < a.length && a[cur] == 0) {
			++cur;
		}
		int c0 = cur;
		while (cur < a.length && a[cur] == 1) {
			++cur;
		}
		int c1 = cur - c0;
		if (c0 % 2 == 0) {
			solve(cur, a);
			for (int i = 0; i < c0; ++i) {
				System.out.println(0);
			}
			for (int i = 0; i < c1; ++i) {
				System.out.println(1);
			}
		} else {
			if (c1 > 0) {
				solve(cur, a);
				for (int i = 0; i < c0 - 1; ++i) {
					System.out.println(0);
				}
				System.out.println(1);
				System.out.println(0);
				for (int i = 0; i < c1 - 1; ++i) {
					System.out.println(1);
				}
			} else {
				solve(cur + 1, a);
				for (int i = 0; i < c0 - 1; ++i) {
					System.out.println(0);
				}
				if (cur < a.length) {
					System.out.println(a[cur]);
				}
				System.out.println(0);
			}
		}
	}

	static void solve(int pos, int[] a) {
		if (pos <= a.length - 2 && a[a.length - 2] == 2 && a[a.length - 1] == 3) {
			for (int i = pos; i < a.length - 2; ++i) {
				System.out.println(2);
			}
			System.out.println(3);
			System.out.println(2);
			return;
		}
		for (int i = pos; i < a.length; ++i) {
			System.out.println(a[i]);
		}
	}

}

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

#include<iostream>
#include<algorithm>
#include<vector>
#include<cmath>
using namespace std;
int n, a[7] = { 0,1,2,3,4,5,6 };
int b[100000], zero, ichi, ni, san, yon;
long long p;
vector<int>vec;
int main() {
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> b[i];
	}
	if (n == 3 && b[0] == 0 && b[1] == 4 && b[2] == 2) {
		cout << "4" << endl << "2" << endl << "0" << endl; return 0;
	}
	sort(b, b + n);
	for (int i = 0; i < n; i++) {
		if (b[i] == 0) {
			zero++;
		}
		else if (b[i] == 1) {
			ichi++;
		}
		else if (b[i] == 2) {
			ni++;
		}
		else if (b[i] == 3) {
			san++;
		}
		else {
			yon++;
		}
	}
	if (san == 1 && yon == 0 && ni >= 1;) {
		if (zero != 1) {
			for (int i = 0; i < (n - zero - ichi) - 2; i++) {
				cout << "2" << endl;
			}
			cout << "3" << endl << "2" << endl;
		}
		else {
			for (int i = 0; i < (n - zero - ichi) - 3; i++) {
				cout << "2" << endl;
			}
			cout << "3" << endl << "2" << endl << "2" << endl;
		}
	}
	else if (zero == 1 && ichi == 0 && ni == 1 && san == 2) { 
		cout << "3" << endl << "3" << endl << "2" << endl; 
	}
	else {
		for (int i = 0; i < n; i++) {
			if (b[i] >= 2) {
				cout << b[i] << endl;
			}
		}
	}
	if (zero == 1 && ichi == 0) {
		cout << "0" << endl;
	}
	else if (zero % 2 == 0) {
		for (int i = 0; i < zero; i++) {
			cout << "0" << endl;
		}
		for (int i = 0; i < ichi; i++) {
			cout << "1" << endl;
		}
	}
	else {
		for (int i = 1; i < zero; i++) {
			cout << "0" << endl;
		}
		cout << "1" << endl << "0" << endl;
		for (int i = 1; i < ichi; i++) {
			cout << "1" << endl;
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:45: error: expected primary-expression before ')' token
   36 |         if (san == 1 && yon == 0 && ni >= 1;) {
      |                                             ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

namespace {

    typedef double real;
    typedef long long ll;

    template<class T> ostream& operator<<(ostream& os, const vector<T>& vs) {
        for (int i = 0; i < vs.size(); i++) {
            os << vs[i] << endl;
        }
        return os;
    }
    template<class T> istream& operator>>(istream& is, vector<T>& vs) {
        for (auto it = vs.begin(); it != vs.end(); it++) is >> *it;
        return is;
    }

    bool comp(int a, int b) {
        if (a == b) return true;
        if (a > b) return not comp(b, a);
        if (a == 1) return false;
        if (a == 2) {
            if (b == 3) return false;
            else return true;
        }
        return true;
    }

    int N;
    vector<int> A;
    void input() {
        cin >> N;
        A.clear(); A.resize(N); cin >> A;
    }

    /* 0(1????????????2????????¶?????????
     * 0(2??????????????????????????
     * 1???????????????????? */
    /* 2, 3????????¨?????????3, 2????????¶??´??????/

    const int INF = 1<<28;

    int step(vector<int>& ans, vector<int>& stack, int prev) {
        int x = stack.back(); stack.pop_back();
        if (comp(x, prev)) {
            vector<int> a;
            a.push_back(x);
            a.insert(a.end(), ans.begin(), ans.end());
            ans = a;
            return INF;
        } else {
            ans.push_back(x);
            real p = pow(real(prev), x);
            return (p >= INF ? INF : int(p));
        }
    }

    void solve() {
        vector<int> nA;
        int zcount = 0;
        for (int i = 0; i < N; i++) {
            if (A[i] == 0) zcount++;
            else nA.push_back(A[i]);
        }
        vector<int> ans;
        if (zcount % 2 == 0) {
            sort(nA.begin(), nA.end());
            int p = nA.back(); nA.pop_back();
            ans.push_back(p);
            while (not nA.empty()) {
                p = step(ans, nA, p);
            }
            for (int i = 0; i < zcount; i++) ans.push_back(0);
        } else {
            sort(A.begin(), A.end());
            assert(A[0] == 0);
            for (int i = 0; i < N; i++) {
                if (A[i] > 0) {
                    swap(A[0], A[i]);
                    break;
                }
            }
            ans = A;
        }
        cout << ans;
    }
}

int main() {
    input(); solve();
    return 0;
}

Compiler output:
a.cc:42:50: warning: trigraph ??/ ignored, use -trigraphs to enable [-Wtrigraphs]
   42 |     /* 2, 3????????¨?????????3, 2????????¶??´??????/
a.cc:42:5: error: unterminated comment
   42 |     /* 2, 3????????¨?????????3, 2????????¶??´??????/
      |     ^
a.cc:37:6: error: expected '}' at end of input
   37 |     }
      |      ^
a.cc:5:11: note: to match this '{'
    5 | namespace {
      |           ^
Language: C++

#include <iostream>
#include <vector>
using namespace std;
int main(){
  int N;
  cin >> N;
  vector<int> A(N);
  for(int i = 0; i < N; ++i) cin >> A[i];
  sort(A.begin(), A.end());
  int t = 0;
  while(t < N && !A[t]) ++t;
  vector<int> B(t,0);
  if(t%2){
    B.push_back(A[t]);
    ++t;
  }
  if(t + 2 > N && A[N-1] == 3 && A[N-2] == 2){
    B.push_back(2);
    B.push_back(3);
    t += 2;
    N -= 2;
  }
  reverse(B.begin(), B.end());
  for(int i = t; i < N; ++i) cout << A[i] << endl;
  for(int i = 0; i < t; ++i) cout << B[i] << endl;
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'sort' was not declared in this scope; did you mean 'short'?
    9 |   sort(A.begin(), A.end());
      |   ^~~~
      |   short
a.cc:23:3: error: 'reverse' was not declared in this scope
   23 |   reverse(B.begin(), B.end());
      |   ^~~~~~~
Language: C++

#include<cstdio>
#include<iostream>
#include<vector>
#include<string>
#include<queue>
#include<set>
#include<map>

using namespace std;

#define reps(i,f,n) for(int i=f;i<int(n);i++)
#define rep(i,n) reps(i,0,n)
#define pb push_back
int main(){
	int n;
	cin>>n;
	
	vector<int> num;
	int zero=0;
	rep(i,n){
		int a;
		cin>>a;
		if(a!=0)num.push_back(a);
		else zero++;
	}
	
	sort(num.begin(),num.end());
	
	rep(i,num.size()){
		printf("%d\n",num[i]);
	}
	rep(i,zero){
		puts("0");
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   27 |         sort(num.begin(),num.end());
      |         ^~~~
      |         short
Language: C++

#include<cstdio>
#include<iostream>
#include<vector>
#include<string>
#include<queue>
#include<set>
#include<map>

using namespace std;

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

int main(){
	int n;
	cin>>n;
	
	vector<int> num;
	int z=0;
	rep(i,n){
		int a;
		cin>>a;
		if(a!=0)num.push_back(a);
		else z++;
	}
	
	sort(num.begin(),num.end());
	
	rep(i,num.size()){
		printf("%d\n",num[i]);
	}
	rep(i,z){
		puts("0");
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   27 |         sort(num.begin(),num.end());
      |         ^~~~
      |         short
Language: C++

#include <iostream>
#include <string>
#include <map>
#include <cstdlib>
using namespace std;

int knapsack[1<<7][10005];
int dp[8][1<<8], tsp[1<<8], profit[1<<7];
int total[10005];
int value[7], weight[7];
int cn[8], cp[8][8], cv[8][8], cx[8], cy[8];

int main()
{
	int N,M,W,T;
	while(cin >> N >> M >> W >> T) {
		map<string, int> dic;
		for(int i=0; i<M; i++) {
			string s;
			int v,p;
			cin >> s >> v >> p;
			dic[s] = i;

			weight[dic[s]] = v;
			value[dic[s]] = p;
		}

		cn[0] = cx[0] = cy[0] = 0;
		for(int i=1; i<=N; i++) {
			cin >> cn[i] >> cx[i] >> cy[i];

			for(int j=0; j<cn[i]; j++) {
				string s;
				int v;
				cin >> s >> v;
				cv[i-1][j] = max(0, value[dic[s]] - v);
				cp[i-1][j] = dic[s];
			}
		}

		memset(profit, 0, sizeof(profit));
		memset(knapsack, -1, sizeof(knapsack));
		for(int i=0; i<(1<<N); i++) {
			knapsack[i][0] = 0;
			for(int j=1; j<=N; j++) {
				if(!(i >> (j-1) & 1)) continue; 
				for(int k=0; k<cn[j]; k++) {
					int id = cp[j-1][k];
					for(int l=0; l<=W - weight[id]; l++) {
						if(knapsack[i][l] == -1) continue;
						knapsack[i][l + weight[id]] = max(knapsack[i][l + weight[id]], knapsack[i][l] + cv[j-1][k]);
						profit[i] = max(profit[i], knapsack[i][l + weight[id]]);
					}
				}
			}
		}

		N++;
		for(int j=0; j<N; j++)
		for(int i=0; i<(1<<N); i++) {
			dp[j][i] = (1<<28);
			tsp[i] = (1<<28);
		}


		dp[0][0] = 0;
		tsp[0] = 0;
		for(int i=0; i<(1<<(N)); i++) {
			for(int j=0; j<N; j++) 
			for(int k=0; k<N; k++) {
				dp[k][i | (1<<k)] = min(dp[k][i | (1<<k)], dp[j][i] + abs(cx[j]-cx[k]) + abs(cy[j]-cy[k]));
				tsp[i | (1<<k)] = min(tsp[i | (1<<k)], dp[k][i | (1<<k)] + abs(cx[k]-cx[0]) + abs(cy[k]-cy[0]));
			}
		}

		memset(total, -1, sizeof(total));
		total[0] = 0;
		for(int i=0; i<(1<<N); i++) {
			for(int j=0; j<=T; j++) {
				if(j + tsp[i] > T) break;
				if(total[j] == -1) continue;
				total[j+tsp[i]] = max(total[j+tsp[i]], total[j] + profit[i>>1]);
			}
		}

		int res = 0;
		for(int i=0; i<=T; i++)
			res = max(res, total[i]);

		cout << res << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:17: error: 'memset' was not declared in this scope
   41 |                 memset(profit, 0, sizeof(profit));
      |                 ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include <cstdlib>
  +++ |+#include <cstring>
    5 | using namespace std;
Language: C

#include <stdio.h>

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

int n,H,W;
char c;

int memo[65536];
int visi[65536];
int Q[65537];
int head = 0 , size = 0;
int A[10000],B[10000],sz=0;
char goal[5][5];
int w[20],h[20];

inline void gen(int s,int x,int y){
	rep(k,3){
		int a=0,b=0;
		rep(i,h[s]){
			rep(j,w[s]){
				int tx = x + j;
				int ty = y + i;
				if(tx >= 0 && tx < 4 && ty < 4 && ty >= 0){
						a |= 1<<(ty*4+tx);
						b |= (goal[ty][tx] == k)<<(ty*4+tx);
				}
			}
		}
		if(b){
			A[sz] = a;
			B[sz] = b;
			++sz;
		}
	}
}
int f(){
	Q[size++] = 0;
	memo[0] = 0;
	int good = (1<<16)-1;
	while(head < size){
		int q = Q[head++];
		int cost = memo[q];
		if(good == q) return cost;
		
		rep(i,sz){
			int bit = (q & ~A[i]) | B[i];
			if(!visi[bit]){
				visi[bit] = 1;
				memo[bit] = cost + 1;
				Q[size++] = bit;
			}
		}
	}
	

}

int main(){
	scanf("%d",&n);
	rep(i,n) scanf("%d%d",h+i,w+i);
	rep(i,4){
		scanf("%s",goal[i]);
		rep(j,4){
			if(goal[i][j]=='R')goal[i][j] = 0;
			else if(goal[i][j]=='G')goal[i][j] = 1;
			else if(goal[i][j]=='B')goal[i][j] = 2;
		}
	}
	rep(k,n){
		rep(i,7)rep(j,7){
			gen(k,i-3,j-3);
		}
	}
	printf("%d\n",f());
	
	
}

Compiler output:
/usr/bin/ld: /tmp/ccemtScp.o: in function `main':
main.c:(.text+0x38d): undefined reference to `gen'
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
#include <vector>
#include <queue>
#include <set>
#define inf 1000000000

using namespace std;

int N;
int H[16], W[16];
int C[4][4];
bool rect[4][4][4][4];

const int V = 1 << 16;
set<unsigned short> G[V];
int dist[V];

void bfs()
{
	queue<int> Q;
	
	for(int i = 0; i < V; i++) dist[i] = inf;
	dist[0] = 0;
	Q.push(0);
	
	int u;
	while(Q.size()){
		u = Q.front(); Q.pop();
		for(int i = 0; i < G[u].size(); i++){
			if(dist[G[u][i]] < inf) continue;
			dist[G[u][i]] = dist[u] + 1;
			Q.push(G[u][i]);
		}
	}
}

int main(void)
{
	cin >> N;
	
	int h, w;
	for(int i = 0; i < N; i++) cin >> H[i] >> W[i];
	
	for(int i = 0; i < 4; i++){
		for(int j = 0; j < 4; j++){
			for(int k = 0; k < 4; k++){
				for(int l = 0; l < 4; l++){
					rect[i][j][k][l] = false;
				}
			}
		}
	}
	
	for(int j = 0; j < N; j++){
		for(int x = 1 - W[j]; x < 4; x++){
			for(int y = 1 - H[j]; y < 4; y++){
				rect[max(x, 0)][min(x+W[j],4)-1][max(y, 0)][min(y+H[j],4)-1] = true;
			}
		}
	}
	
	char c;
	for(int y = 0; y < 4; y++){
		for(int x = 0; x < 4; x++){
			cin >> c;
			if(c == 'R') C[x][y] = 0;
			if(c == 'G') C[x][y] = 1;
			if(c == 'B') C[x][y] = 2;
		}
	}
	
	int next;
	for(int i = 0; i < V; i++){
		for(int k = 0; k < 3; k++){
			next = i;
			for(int p = 0; p < 4; p++){
				for(int q = 0; q < 4; q++){
					for(int r = 0; r < 4; r++){
						for(int s = 0; s < 4; s++){
							if(!rect[p][q][r][s]) continue;
							next = i;
							for(int dx = p; dx <= q; dx++){
								for(int dy = r; dy <= s; dy++){
									if(C[dx][dy] == k) next |= (1 << (dy*4+dx));
									else next &= ~(1 << (dy*4+dx));
								}
							}
							G[i].insert(next);
						}
					}
				}
			}
		}
	}
	
	bfs();
	cout << dist[V-1] << endl;
	return 0;
}

Compiler output:
a.cc: In function 'void bfs()':
a.cc:30:37: error: no match for 'operator[]' (operand types are 'std::set<short unsigned int>' and 'int')
   30 |                         if(dist[G[u][i]] < inf) continue;
      |                                     ^
a.cc:31:34: error: no match for 'operator[]' (operand types are 'std::set<short unsigned int>' and 'int')
   31 |                         dist[G[u][i]] = dist[u] + 1;
      |                                  ^
a.cc:32:36: error: no match for 'operator[]' (operand types are 'std::set<short unsigned int>' and 'int')
   32 |                         Q.push(G[u][i]);
      |                                    ^
Language: C++

#include <iostream>
#include <vector>
#include <queue>
#include <set>
#define inf 1000000000

using namespace std;

int N;
int H[16], W[16];
int C[4][4];
bool rect[4][4][4][4];

const int V = 1 << 16;
set<int> G[V];
int dist[V];

void bfs()
{
	queue<int> Q;
	
	for(int i = 0; i < V; i++) dist[i] = inf;
	dist[0] = 0;
	Q.push(0);
	
	int u;
	while(Q.size()){
		u = Q.front(); Q.pop();
		for(int i = 0; i < G[u].size(); i++){
			if(dist[G[u][i]] < inf) continue;
			dist[G[u][i]] = dist[u] + 1;
			Q.push(G[u][i]);
		}
	}
}

int main(void)
{
	cin >> N;
	
	int h, w;
	for(int i = 0; i < N; i++) cin >> H[i] >> W[i];
	
	for(int i = 0; i < 4; i++){
		for(int j = 0; j < 4; j++){
			for(int k = 0; k < 4; k++){
				for(int l = 0; l < 4; l++){
					rect[i][j][k][l] = false;
				}
			}
		}
	}
	
	for(int j = 0; j < N; j++){
		for(int x = 1 - W[j]; x < 4; x++){
			for(int y = 1 - H[j]; y < 4; y++){
				rect[max(x, 0)][min(x+W[j],4)-1][max(y, 0)][min(y+H[j],4)-1] = true;
			}
		}
	}
	
	char c;
	for(int y = 0; y < 4; y++){
		for(int x = 0; x < 4; x++){
			cin >> c;
			if(c == 'R') C[x][y] = 0;
			if(c == 'G') C[x][y] = 1;
			if(c == 'B') C[x][y] = 2;
		}
	}
	
	int next;
	for(int i = 0; i < V; i++){
		for(int k = 0; k < 3; k++){
			next = i;
			for(int p = 0; p < 4; p++){
				for(int q = 0; q < 4; q++){
					for(int r = 0; r < 4; r++){
						for(int s = 0; s < 4; s++){
							if(!rect[p][q][r][s]) continue;
							next = i;
							for(int dx = p; dx <= q; dx++){
								for(int dy = r; dy <= s; dy++){
									if(C[dx][dy] == k) next |= (1 << (dy*4+dx));
									else next &= ~(1 << (dy*4+dx));
								}
							}
							G[i].insert(next);
						}
					}
				}
			}
		}
	}
	
	bfs();
	cout << dist[V-1] << endl;
	return 0;
}

Compiler output:
a.cc: In function 'void bfs()':
a.cc:30:37: error: no match for 'operator[]' (operand types are 'std::set<int>' and 'int')
   30 |                         if(dist[G[u][i]] < inf) continue;
      |                                     ^
a.cc:31:34: error: no match for 'operator[]' (operand types are 'std::set<int>' and 'int')
   31 |                         dist[G[u][i]] = dist[u] + 1;
      |                                  ^
a.cc:32:36: error: no match for 'operator[]' (operand types are 'std::set<int>' and 'int')
   32 |                         Q.push(G[u][i]);
      |                                    ^
Language: C++

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

set<int> stamp;
vector<int> memo(1<<16, -1);
vector<bitset<16> > color(3);

int solve(bitset<16> bs, int depth)
{
	if(bs.all())
		return 0;
	if(memo[bs.to_ulong()] != -1)
		return memo[bs.to_ulong()];
	if(depth > 16)
		return INT_MAX / 2;

	memo[bs.to_ulong()] = INT_MAX / 2;

	int ret = INT_MAX / 2;
	set<int>::iterator it;
	for(it=stamp.begin(); it!=stamp.end(); ++it){
		for(int i=0; i<3; ++i){
			if((bitset<16>(*it) & color[i]).none())
				continue;
			bitset<16> bs2 = bs & ~bitset<16>(*it);
			bs2 |= bitset<16>(*it) & color[i];
			ret = min(ret, 1 + solve(bs2, depth+1));
		}
	}

	return memo[bs.to_ulong()] = ret;
}

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

	for(int i=0; i<n; ++i){
		int h, w;
		cin >> h >> w;
		for(int j=-3; j<4; ++j){
			for(int k=-3; k<4; ++k){
				bitset<16> bs;
				for(int y=j; y<j+h; ++y){
					for(int x=k; x<k+w; ++x){
						if(0 <= y && y <4 && 0 <= x && x < 4)
							bs[y*4+x] = true;
					}
				}
				if(bs.any())
					stamp.insert(bs.to_ulong());
			}
		}
	}

	for(int i=0; i<16; ++i){
		char c;
		cin >> c;
		if(c == 'R')
			color[0][i] = true;
		else if(c == 'G')
			color[1][i] = true;
		else
			color[2][i] = true;
	}

	cout << solve(0, 0) << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int solve(std::bitset<16>, int)':
a.cc:21:24: error: 'INT_MAX' was not declared in this scope
   21 |                 return INT_MAX / 2;
      |                        ^~~~~~~
a.cc:8:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    7 | #include <bitset>
  +++ |+#include <climits>
    8 | using namespace std;
a.cc:23:31: error: 'INT_MAX' was not declared in this scope
   23 |         memo[bs.to_ulong()] = INT_MAX / 2;
      |                               ^~~~~~~
a.cc:23:31: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
Language: C++

#include <stdio.h>
#include <iostream>
#include <vector>
#include <list>
#include <cmath>
#include <fstream>
#include <algorithm>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <complex>
#include <iterator>
#include <cstdlib>
#include <cstring>
#include <sstream>

using namespace std;

#define EPS (1e-10)
#define EQ(a,b) (abs((a) - (b)) < EPS)
#define EQV(a,b) (EQ((a).real(),(b).real()) && EQ((a).imag(),(b).imag()))

typedef complex<double> P;
typedef long long ll;

const int MAX_SIZE = 10000;
const int INF=100000000;

// eXªwè³ê½FÉÈéÜÅÌÅ¬X^vñ
int dp[1<<16];
char field[5][5];
vector<pair<int,int> > stumps;
int n;
char color[]={'R','G','B'};

int dfs(int s){
    if(s==0)
        return 0;
    if(dp[s]!=INF)
        return dp[s];
    int cnt=INF;
    // TCYÒÁ½è ¤êðIñÅX^vðßµÄ¢­
    for(int k = 0; k < stumps.size(); k++){
        int h=stumps[k].first;
        int w=stumps[k].second;
        // ¶ãÌÀWðè
        for(int i = -h+1; i < 4; i++){
            for(int j = -w+1; j < 4; j++){
                int ns=s;
                bool first=false;
                bool b=false;
                char cc=0;
                // Iñ¾ÍÍªS¯¶FÅ é©Ç¤©ð`FbN·é
                for(int k = i; k<min(i+h,4); k++){
                    for(int l = j; l < min(j+w,4); l++){
                        if(!(k>=0&&l>=0&&k<4&&l<4))
                            continue;
                        // hçêÄ¢éêÌÝl¶·é
                        if((s>>(k*4+l))&1){
                            if(!first){
                                cc=field[k][l];
                                first=true;
                            }
                            else{
                                if(field[k][l]!=cc){
                                    b=true;
                                    break;
                                }
                            }
                        }
                    }
                    if(b)
                        break;
                }
                // SðÅ«éê,hèÂÔµððµÄAÄA
                if(!b&&first){
                    for(int k = i; k<min(i+h,4); k++){
                        for(int l = j; l < min(j+w,4); l++){
                            if(!(k>=0&&l>=0&&k<4&&l<4))
                                continue;
                            ns&=~(1<<(k*4+l));
                        }
                    }
                    cnt=min(cnt,dfs(ns)+1);
                }
            }
        }
    }
    return dp[s]=cnt;
}

void solve(){
    fill(dp,dp+(1<<16),INF);
    cin>>n;
    int h,w;
    for(int i = 0; i < n; i++){
        cin>>h>>w;
        stumps.push_back(make_pair(h,w));
    }
    for(int i = 0; i < 4; i++)
        for(int j = 0; j < 4; j++)
            cin>>field[i][j];
    cout<<dfs((1<<16)-1)<<endl;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
#include <map>
#include <vector>
using namespace std;
#define rep(i,n) for(int i = 0 ; i < n ; i++)

int n,H,W;
map< vector< vector<char> > , int> done;
vector< vector<char> > goal(7,vector<char>(7));
vector< vector<char> > good(8,vector<char>(8,0)) ;

int w[20],h[20];
int f(vector< vector<char> > &c){
	queue< vector< vector<char> > > Q;
	Q.push(c);
	done[c] = 0;
	
	while(Q.size()){
		vector< vector<char> > &q = Q.front(); Q.pop();
		int cost = done[q];
		if(good == q) return cost;
		
		rep(x,7)rep(y,7){
			rep(i,n){
				rep(color,3){
					if( x < 3 || y < 3 || goal[y][x] == color){
						vector< vector<char> > t = c;
						rep(j,h[i]){
							rep(k,w[i]){
								int tx = x+k;
								int ty = y+j;
								if(tx >= 7 || ty >= 7 || tx < 3 || ty < 3 )continue;
								if(color == goal[ty][tx])t[ty][tx] = 1;
								else t[ty][tx] = 0;
								
								//cout << tx << " " << ty << endl;
							}
						}
						if(done.find(t) == done.end()){
							done[t] = cost + 1;
							Q.push(t);
						}
					}
				}
			}
		}
	}
	

}

int main(){
	cin >> n;
	rep(i,n) cin >> h[i] >> w[i];
	vector< vector<char> > init(8,vector<char>(8,0)) ;
	rep(i,4)rep(j,4){
		char c;cin >> c;
		if(c=='R')c = 0;
		if(c=='G')c = 1;
		if(c=='B')c = 2;
		goal[3+i][3+j] = c;
	}
	rep(i,4)rep(j,4) good[i+3][j+3] = 1;
	
	cout << f(0,init) << endl;
	
	
}

Compiler output:
a.cc: In function 'int f(std::vector<std::vector<char> >&)':
a.cc:14:9: error: 'queue' was not declared in this scope
   14 |         queue< vector< vector<char> > > Q;
      |         ^~~~~
a.cc:4:1: note: 'std::queue' is defined in header '<queue>'; this is probably fixable by adding '#include <queue>'
    3 | #include <vector>
  +++ |+#include <queue>
    4 | using namespace std;
a.cc:14:39: error: expected primary-expression before '>' token
   14 |         queue< vector< vector<char> > > Q;
      |                                       ^
a.cc:14:41: error: 'Q' was not declared in this scope
   14 |         queue< vector< vector<char> > > Q;
      |                                         ^
a.cc: In function 'int main()':
a.cc:65:19: error: invalid initialization of non-const reference of type 'std::vector<std::vector<char> >&' from an rvalue of type 'int'
   65 |         cout << f(0,init) << endl;
      |                   ^
a.cc:13:31: note: in passing argument 1 of 'int f(std::vector<std::vector<char> >&)'
   13 | int f(vector< vector<char> > &c){
      |       ~~~~~~~~~~~~~~~~~~~~~~~~^
a.cc: In function 'int f(std::vector<std::vector<char> >&)':
a.cc:50:1: warning: control reaches end of non-void function [-Wreturn-type]
   50 | }
      | ^
Language: C++

#include <iostream>
#include <map>
#include <vector>
#include <queue>
using namespace std;
#define rep(i,n) for(int i = 0 ; i < n ; i++)

int n,H,W;
map< vector< vector<char> > , int> done;
vector< vector<char> > goal(7,vector<char>(7));
vector< vector<char> > good(8,vector<char>(8,0)) ;

int w[20],h[20];
int f(vector< vector<char> > &c){
	queue< vector< vector<char> > > Q;
	Q.push(c);
	done[c] = 0;
	
	while(Q.size()){
		vector< vector<char> > &q = Q.front(); Q.pop();
		int cost = done[q];
		if(good == q) return cost;
		
		rep(x,7)rep(y,7){
			rep(i,n){
				rep(color,3){
					if( x < 3 || y < 3 || goal[y][x] == color){
						vector< vector<char> > t = c;
						rep(j,h[i]){
							rep(k,w[i]){
								int tx = x+k;
								int ty = y+j;
								if(tx >= 7 || ty >= 7 || tx < 3 || ty < 3 )continue;
								if(color == goal[ty][tx])t[ty][tx] = 1;
								else t[ty][tx] = 0;
								
								//cout << tx << " " << ty << endl;
							}
						}
						if(done.find(t) == done.end()){
							done[t] = cost + 1;
							Q.push(t);
						}
					}
				}
			}
		}
	}
	

}

int main(){
	cin >> n;
	rep(i,n) cin >> h[i] >> w[i];
	vector< vector<char> > init(8,vector<char>(8,0)) ;
	rep(i,4)rep(j,4){
		char c;cin >> c;
		if(c=='R')c = 0;
		if(c=='G')c = 1;
		if(c=='B')c = 2;
		goal[3+i][3+j] = c;
	}
	rep(i,4)rep(j,4) good[i+3][j+3] = 1;
	
	cout << f(0,init) << endl;
	
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:66:19: error: invalid initialization of non-const reference of type 'std::vector<std::vector<char> >&' from an rvalue of type 'int'
   66 |         cout << f(0,init) << endl;
      |                   ^
a.cc:14:31: note: in passing argument 1 of 'int f(std::vector<std::vector<char> >&)'
   14 | int f(vector< vector<char> > &c){
      |       ~~~~~~~~~~~~~~~~~~~~~~~~^
a.cc: In function 'int f(std::vector<std::vector<char> >&)':
a.cc:51:1: warning: control reaches end of non-void function [-Wreturn-type]
   51 | }
      | ^
Language: C++

// Enjoy your stay.

#include <bits/stdc++.h>

#define EPS 1e-9
#define INF 1070000000LL
#define MOD 1000000007LL
#define fir first
#define foreach(it,X) for(auto it=(X).begin();it!=(X).end();it++)
#define ite iterator
#define mp make_pair
#define mt make_tuple
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<(n);i++)
#define pb push_back
#define sec second
#define sz(x) ((int)(x).size())

using namespace std;

typedef istringstream iss;
typedef long long ll;
typedef pair<ll,ll> pi;
typedef stringstream sst;
typedef vector<ll> vi;

int N,H[17],W[17];
int c[5][5];
int dist[1<<16];

int main(){
	cin.tie(0);
	ios_base::sync_with_stdio(0);
	
	cin>>N;
	rep(i,N)cin>>H[i]>>W[i];
	rep(i,4)rep(j,4){
		char C;
		cin>>C;
		c[i][j] = C=='R' ? 0 : C=='G' ? 1 : 2;
	}
	rep(i,1<<16)dist[i] = INF;
	dist[0] = 0;
	queue<int> Q;
	Q.push(0);
	while(sz(Q)){
		int mask = Q.front(); Q.pop();
		if(mask == (1<<16)-1){
			return cout<<dist[mask]<<endl,0;
		}
		int done[4][4][4][4][3] = {};
		rep(i,N){
			rep2(y,-H[i]+1,4)rep2(x,-W[i]+1,4)rep(color,3){
				int nmask = mask;
				int y0 = max(0, y);
				int x0 = max(0, x);
				int y1 = min(3, y+H[i]-1);
				int x1 = min(3, x+W[i]-1);
				if(done[y0][x0][y1][x1][color])continue;
				done[y0][x0][y1][x1] = 1;
				rep(ii,H[i])rep(jj,W[i]){
					int Y = y+ii, X = x+jj;
					if(Y<0 || Y>=4 || X<0 || X>=4)continue;
					if(c[Y][X] == color) nmask |= 1<<Y*4+X;
					else nmask &= ~(1<<Y*4+X);
				}
				if(dist[nmask] > dist[mask] + 1){
					dist[nmask] = dist[mask] + 1;
					Q.push(nmask);
				}
			}
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:60:54: error: incompatible types in assignment of 'int' to 'int [3]'
   60 |                                 done[y0][x0][y1][x1] = 1;
      |                                 ~~~~~~~~~~~~~~~~~~~~~^~~
Language: C++

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

int main(){
	int n , k , t , u , v , l;
	cin >> n >> k >> t >> u >> v >> l;
	int* d = new int [n+1];
	for(int i=0;i<n;++i){
		cin >> d[i];
	}
	d[n]=l;
	int pos=0,m=0,stock=0;
	double ans=0;
	while(pos<l){
		if(pos<d[m]){ //?¬?????????????????????§????????????????????¨???
			if(stock>0){  //??????????????????????????????????????°?§?????????¢???t*v;
				--stock;
				int tmp = min( l , pos+t*v); 
				ans+=(tmp-pos+0.) /v; //???????????????  =  ????????????+t 
				pos=tmp;
			} else { //?????????????????????????????????????????°?¬?????????????????????§ u m/s  ??§?????????;
				ans+=(d[m]-pos+0.)/u;  
				pos = d[m];
			}
		} else {  //?¬?????????????????????§?????????????????????????¶???????????????¨??????m++
			if(stock==0){  
				if(d[m]==pos){  
					int tmp = min( l , pos+t*v);
					ans+=(tmp-pos+0.)/v;
					pos=tmp;
					++m;  
				} else {
					++stock;
					++m;
				}
			} else if(stock==k){  
				int tmp = min( l , d[m]+t*v);
				ans+=(tmp-pos+0.)/v;
				pos = tmp;
				++m;
			} else { 
				++stock;
				++m;
			}
		}
	}
	cout << fixed << setprecision(9) << ans <<endl;
	delete [] d;
	ansurn 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:49:9: error: 'ansurn' was not declared in this scope
   49 |         ansurn 0;
      |         ^~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <iomanip>
using namespace std;

int main(){
  int N,K,T,L;
  double U,V;
  cin >> N >> K >> T >> U >> V >> L;
  vector<int> D(N+1,0);
  D[N+1]=0;
  for(int i=0;i<N;++i){
    cin >> D[i];
  }
  double Time=0;
  int pos=0;
  int Npos=0;
  int until=0;
  while(pos < L){
    if(pos==D[Npos]){
      ++Npos;
      until+=T*V;
      if(until>(K+1)*T*V){
	until=(K+1)*T*V;
      }
    }
    //cout << "proceed" << endl;

    if(until==0){
      Time+=1/U;
    }else{
      Time+=1/V;
      --until;   
    }
    pos+=1;
  }
  cout << setiosflags(ios::fixed) << setprecision(15) << Time << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:37:71: error: expected '}' at end of input
   37 |   cout << setiosflags(ios::fixed) << setprecision(15) << Time << endl;
      |                                                                       ^
a.cc:6:11: note: to match this '{'
    6 | int main(){
      |           ^
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<cmath>
using namespace std;

#define rep(i, j) for(int i=0; i < (int)(j); i++)
// vector
template<class T> istream& operator >> (istream &is , vector<T> &v) {
    for(T &a : v) is >> a; return is;
}

bool solve() {
    int N, K, T, U, V, L; cin >> N >> K >> T >> U >> V >> L;
    vector<int> D(N); cin >> D;
    sort(all(D));
    int carrot = 0;
    int left_time = 0;
    int high_speed_range = 0;
    int di = 0;
    rep(l, L) {
        if(di < N and D[di] == l) {
            if(carrot == K) left_time = T * V;
            else carrot++;
            di++;
        }
        if(carrot > 0 and left_time == 0) {
            carrot--;
            left_time = T * V;
        }

        high_speed_range += (left_time > 0);
        left_time = max(0, left_time - 1);
    }
    printf("%.10f\n", (double)(L - high_speed_range) / U + (double)(high_speed_range) / V);
    
    return false;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    while(solve());
    return 0;
}

Compiler output:
a.cc: In function 'bool solve()':
a.cc:18:10: error: 'all' was not declared in this scope
   18 |     sort(all(D));
      |          ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
int main(){
  lli n, k, t, u, v, l;
  std::cin >> n >> k >> t >> u >> v >> l;
  vector<lli> d(n);
  for (int i = 0; i < n; i++) {
    std::cin >> d[i];
  }
  double ans = 0;
  vector<int> course(l + 2, 0);
  for (int i = 0; i < n; i++) {
    course[d[i]]++;
    course[min(d[i] + t*v, l + 1)]--;
  }
  double sum = 0;
  for (int i = 0; i < l; i++) {
    course[i + 1] = min(course[i + 1] + course[i], k + 1);
  }

  for (int i = 0; i < l; i++) {
    if(course[i] == 0 and sum > 0)sum--, course[i]++;
    sum += max(course[i] - 1, 0);
    course[i] = (course[i] > 0);
  }
  sum = 0;
  for (int i = 0; i < l; i++) {
    sum += course[i];
  }
  std::cout << setprecision(15) << sum/v + (l - sum)/u << std::endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:24: error: no matching function for call to 'min(__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type, lli)'
   19 |     course[i + 1] = min(course[i + 1] + course[i], k + 1);
      |                     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:19:24: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'lli' {aka 'long long int'})
   19 |     course[i + 1] = min(course[i + 1] + course[i], k + 1);
      |                     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:19:24: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   19 |     course[i + 1] = min(course[i + 1] + course[i], k + 1);
      |                     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <typeinfo>
#include <numeric>
#include <functional>
#include <unordered_map>
#include <bitset>


using namespace std;
using ll = long long;
using ull = unsigned long long;

const ll INF = 1e16;
const ll MOD = 1e9 + 7;

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



int main() {
    int n, k, l;
    double t, u, v, d[200];
    
    cin >> n >> k >> t >> u >> v >> l;
    REP(i, n){
        cin >> d[i];
    }
    
    double ans = 0.0;
    int boost_time = 0, ninjin_p = 0, boost_cnt = 0;
    for(int i = 1; i <= l; i++){
        if(boost_time){
            ans += 1.0 / v + 1e-15;
            boost_time--;
        }
        else{
            ans += 1.0 / u + 1e-15;
        }
        
        if(i == d[ninjin_p]){
            if(boost_time >= k * v){
                boost_time = (k + 1) * v;
            }
            else{
                boost_time += v;
            }
            if(ninjin_p < n - 1)ninjin_p++;
        }
    }
    
    printf("%.11lf\n",


Compiler output:
a.cc: In function 'int main()':
a.cc:62:23: error: expected primary-expression at end of input
   62 |     printf("%.11lf\n",
      |                       ^
a.cc:62:23: error: expected '}' at end of input
a.cc:31:12: note: to match this '{'
   31 | int main() {
      |            ^
Language: Java

import java.util.Scanner;

public class Main {
	
	public static void main(String[] args) {
		
		new CopyOfMain().run();
		return;
	}
	
	Scanner scanner = new Scanner(System.in);
	int m;
	int[][][] tile = new int[26][2][2];
	boolean[] cantGet =new boolean[26];
	int score = 0;
	
	void run() {
		
		m = scanner.nextInt();
		scanner.nextInt();
		
		for (int color = 0; color < 26; color ++) {
			
			tile[color][0][0] = -1;
			cantGet[color] = true;
		}
		
		for (int y = 0; y < m; y ++) {
			
			char[] line = scanner.next().toCharArray();
			
			for (int x = 0; x < line.length; x ++) {
				
				if(line[x] != '.') {
					
					int color = line[x] - 'A';
					cantGet[color] = false;
					int index = (tile[color][0][0] == -1) ? 0: 1;
					tile[color][index][0] = x;
					tile[color][index][1] = y;
				}
			}
		}
		
		int preScore;
		do {
			
			preScore = score;
			
			for (int color = 0; color < 26; color ++) {
				
				tryGet(color);
			}
			
		} while(preScore != score);
		
		System.out.println(score * 2);
	}
	
	void tryGet(int color) {
		
		if (cantGet[color]) {
			
			return;
		}
		
		if ((tile[color][0][0] == tile[color][1][0]
				&& Math.abs(tile[color][0][1] - tile[color][1][1]) == 1)
				|| (tile[color][0][1] == tile[color][1][1]
				&& Math.abs(tile[color][0][0] - tile[color][1][0]) == 1)) {
				
			cantGet[color] = true;
			return;
		}
		
		if((isEmpty(color, 1, tile[color][0][0], tile[color][0][1], tile[color][1][1])
				&& isEmpty(color, 0, tile[color][1][1], tile[color][0][0], tile[color][1][0]))
				|| (isEmpty(color, 1, tile[color][1][0], tile[color][0][1], tile[color][1][1])
						&& isEmpty(color, 0, tile[color][0][1], tile[color][0][0], tile[color][1][0]))) {
			
			get(color);
		}
	}
	
	boolean isEmpty(int skip,int axis, int point, int start, int end) {
		
		
		if (start == end) {
			
			return true;
		}
		
		if (start > end) {
			
			int swap = start;
			start = end;
			end = swap;
		}
		
		for (int color = 0; color < 26; color ++) {
			
			if (color == skip
					|| tile[color][0][0] == -1) {
				
				continue;
			}
			
			for (int index = 0; index < 2; index ++) {
				
				if (tile[color][index][1 - axis] == point
						&& tile[color][index][axis] >= start
						&& tile[color][index][axis] <= end) {
					
					return false;
				}
			}
		}
		
		return true;
	}
	
	void get(int color) {
		
		tile[color][0][0] = -1;
		score ++;
	}
}

Compiler output:
Main.java:7: error: cannot find symbol
		new CopyOfMain().run();
		    ^
  symbol:   class CopyOfMain
  location: class Main
1 error
Language: C++

#include<iostream>

using namespace std;

int main(){
  int n;
 
      string s;
      int n,m;
      cin >> n >> m;
      cerr << n << m << endl;
      for(int i=0;i<n;i++){
	cin >> s;
	cerr << s << endl;
      }
      cout << "3" << endl;
    


  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:11: error: redeclaration of 'int n'
    9 |       int n,m;
      |           ^
a.cc:6:7: note: 'int n' previously declared here
    6 |   int n;
      |       ^
Language: C++

#include<iostream>

using namespace std;

int main(){
  int n;
 
      string s;
      int n,m;
      while(cin >> n >> m){
      cerr << n << m << endl;
      for(int i=0;i<n;i++){
	cin >> s;
	cerr << s << endl;
      }
      cout << "3" << endl;
	    }


  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:11: error: redeclaration of 'int n'
    9 |       int n,m;
      |           ^
a.cc:6:7: note: 'int n' previously declared here
    6 |   int n;
      |       ^
Language: C++

#include <iostream>
#include <vector>
#define MAX(a,b) ((a>b)?a:b)
using namespace std;
struct ds{
    float L;
    float a;
    float b;
};    

int main(){
    auto f = [](float x,float y,float z){return x*x+y*y+z*z;};
    int i,j,N,M;
    vector<ds> cls;
    cin>>N>>M;
    for(i=0;i<N;i++){
        struct ds buf;
        cin>>buf.L>>buf.a>>buf.b;
        cls.push_back(buf);
    }
    vector<int> tg(N,0);
    vector<ds> q;
    for(i=0;i<M;i++){tg[N-1-i]=1;}
    float r,m=0.0;
    do{
        r=0.0;
        for(i=0;i<N;i++){
            if(tg[i]){q.push_back(cls[i]);}
        }
        for(auto a=q.begin();a!=q.end();a++){
            for(auto b=a+1;b!=q.end();b++){
                r+=f(a->L - b->L,a->a - b->a, a->b - b->b);
            }
        }
        m=MAX(m,r);
        q.clear();
    }while(next_permutation(tg.begin(),tg.end()));
    cout<<m<<endl;    
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:37:12: error: 'next_permutation' was not declared in this scope
   37 |     }while(next_permutation(tg.begin(),tg.end()));
      |            ^~~~~~~~~~~~~~~~