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

#include<iostream>
#include<cstdio>
using namespace std;
int main(void){
	int n;
	scanf("%d",&n);
	for(i=1;i<=n;i++)
	printf("a");
	printf("\n");
	if(n==1)
	return 0;
	for(i=0;i<n;i++)
	printf("%c",'a'+i);
	printf("\n");
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:13: error: 'i' was not declared in this scope
    7 |         for(i=1;i<=n;i++)
      |             ^
a.cc:12:13: error: 'i' was not declared in this scope
   12 |         for(i=0;i<n;i++)
      |             ^
Language: C++

#include<iostream>
#include<vector>
using namespace std;
typedef long int li;
#define rep(i,n) for(int i=0;i<(n);i++)
#define df 0
#define Please return
#define AC 0

int next(vector<int>& vec,vector<int>& dict){
  int k=vec.size(),i=k;
  if(vec[i-1]==0){
    vec[i-1]=1;
    dict[0]--; dict[1]++;
    return 1;
  }
  while(i>=0){
    if(--dict[vec[--i]]) break;
  }
  if(i==-1)return 0;
  vec[i]++; dict[vec[i++]]++;
  while(i<k){
    vec[i++]=0; dict[0]++;
  }
  return 1;
}

void print(vector<int>& vec){
  int n=vec.size();
  rep(i,n) printf("%c",vec[i]+'a');
  printf("\n");
}

int main(){
  int k; cin >>k;
  if(d==1){
    printf("a");
    return 0;
  }
  vector<int> vec(k,0),dict(k,0);
  dict[0]=k;
  print(vec);
  while(next(vec,dict)){
    print(vec);
    if(df) {rep(i,k)printf("%d",dict[i]); printf("\n");}
  }
  
  Please AC;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:36:6: error: 'd' was not declared in this scope
   36 |   if(d==1){
      |      ^
Language: C++

#include<unordered_set>
#include<map>
#include<iostream>
#include<cstdio>
#include<string>
#include<string_view>
#include<algorithm>
using namespace std;

const static string_view ASCII("abcdefghijklmnopqrstuvwxyz");

int N;

string canonical(const string& s) {
    map<char, string> m;
    auto it = ASCII.cbegin();
    string res;
    for (char c : s) {
        if (m.find(c) == m.end()) {
            m[c] = *it;
            ++it;
        }
        res += m[c];
    }
    //cout<<"can:\t"<<s<<"\t"<<res<<endl;
    return res;
}

void rec(int n, string s, unordered_set<string>* seen) {
    if (n==N) {
        string can = canonical(s);
        //seen->insert(can);
        if (!seen->count(can)){
            seen->insert(can);
        }
    } else {
        for (char c : ASCII.substr(0, n+1)) {
            s.push_back(c);
            rec(n+1, s, seen);
            s.pop_back();
        }
    }
}

int main() {    
    cin>>N;
    unordered_set<string> seen;
    rec(0, "", &seen);
    vector<string> ans(seen.begin(), seen.end());
    sort(ans.begin(), ans.end());
    for(const auto& s : ans) {
        cout<<s<<endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:49:5: error: 'vector' was not declared in this scope
   49 |     vector<string> ans(seen.begin(), seen.end());
      |     ^~~~~~
a.cc:8:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    7 | #include<algorithm>
  +++ |+#include <vector>
    8 | using namespace std;
a.cc:49:18: error: expected primary-expression before '>' token
   49 |     vector<string> ans(seen.begin(), seen.end());
      |                  ^
a.cc:49:20: error: 'ans' was not declared in this scope; did you mean 'abs'?
   49 |     vector<string> ans(seen.begin(), seen.end());
      |                    ^~~
      |                    abs
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; ++i)
#define rrep(i, n) for(int i = n-1; i >= 0; --i)
#define fi first
#define se second
using namespace std;
using lint = long long;
using uint = unsigned int;
using ulint = unsigned long long;
using ldouble = long double;
using pii = pair<int, int>;
using pli = pair<lint, lint>;
using pdd = pair<double, double>;
using pld = pair<ldouble, ldouble>;
using v1i = vector<int>;
using v1li = vector<lint>;
using v2i = vector<vector<int>>;
using v2li = vector<vector<lint>>;
using v3i = vector<vector<vector<int>>>;
using v3li = vector<vector<vector<lint>>>;
using v1b = vector<bool>;
using v2b = vector<vector<bool>>;
using v3b = vector<vector<vector<bool>>>;
using v1c = vector<char>;
using v2c = vector<vector<char>>;
using v3c = vector<vector<vector<char>>>;
constexpr lint mod1 = 1e9+7;
constexpr lint mod2 = 998244353;

int nya(string s){
  set<char> u;
  rep(i, s.size()) u.insert(s[i]);
  return u.size();
}

int main() {
  int n;
  cin >> n;
  vector<queue<string>> v(10);
  v[0].insert("a");
  rep(i, n-1){
    while(!v[i].empty()){
      string tmp = v[i].front();
      v[i].pop();
      rep(j, nya(tmp)){
        string t = tmp;
        t += (char)'a'+j;
        v[i+1].insert(t);
      }
    }
  }
  while(!v[n-1].empty()){
    cout << v[n-1].front() << endl;
    v[n-1].pop();
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:8: error: '__gnu_cxx::__alloc_traits<std::allocator<std::queue<std::__cxx11::basic_string<char> > >, std::queue<std::__cxx11::basic_string<char> > >::value_type' {aka 'class std::queue<std::__cxx11::basic_string<char> >'} has no member named 'insert'
   40 |   v[0].insert("a");
      |        ^~~~~~
a.cc:48:16: error: '__gnu_cxx::__alloc_traits<std::allocator<std::queue<std::__cxx11::basic_string<char> > >, std::queue<std::__cxx11::basic_string<char> > >::value_type' {aka 'class std::queue<std::__cxx11::basic_string<char> >'} has no member named 'insert'
   48 |         v[i+1].insert(t);
      |                ^~~~~~
Language: C++

n = int(input())


A = ['a']

for i in range(n-1):
    B = A[i:]
    for j in B:
        A.append("".join(j) + j[-1])
        A.append("".join(j) + chr(ord(j[-1]) + 1))
A = sorted(A)
for i in A:
    if len(i) == n:
        print(i)

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n = int(input())
      | ^
Language: C++

#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
#define rep(i,n) for (ll i = 0; i < (n); i++)
#define repd(i,a,b) for (ll i = (a); i < (b); i++)
#define INF LLONG_MAX
#define mod 1000000007
typedef long long ll;

int main(void)
{
    int a;
    cin >> a;
	cout << aaa << endl;
	cout << aab << endl;
	cout << aba << endl;
	cout << abb << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: 'aaa' was not declared in this scope
   14 |         cout << aaa << endl;
      |                 ^~~
a.cc:15:17: error: 'aab' was not declared in this scope
   15 |         cout << aab << endl;
      |                 ^~~
a.cc:16:17: error: 'aba' was not declared in this scope; did you mean 'abs'?
   16 |         cout << aba << endl;
      |                 ^~~
      |                 abs
a.cc:17:17: error: 'abb' was not declared in this scope; did you mean 'abs'?
   17 |         cout << abb << endl;
      |                 ^~~
      |                 abs
Language: C++

#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
#define rep(i,n) for (ll i = 0; i < (n); i++)
#define repd(i,a,b) for (ll i = (a); i < (b); i++)
#define INF LLONG_MAX
#define mod 1000000007
typedef long long ll;

int main(void)
{
	cout << aaa << endl;
	cout << aab << endl;
	cout << aba << endl;
	cout << abb << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:17: error: 'aaa' was not declared in this scope
   12 |         cout << aaa << endl;
      |                 ^~~
a.cc:13:17: error: 'aab' was not declared in this scope
   13 |         cout << aab << endl;
      |                 ^~~
a.cc:14:17: error: 'aba' was not declared in this scope; did you mean 'abs'?
   14 |         cout << aba << endl;
      |                 ^~~
      |                 abs
a.cc:15:17: error: 'abb' was not declared in this scope; did you mean 'abs'?
   15 |         cout << abb << endl;
      |                 ^~~
      |                 abs
Language: C++

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

int main(void){
	int N,i[10];
	char a[10]="abcdefghij";
	scanf("%d",&N);
	for(i[0]=0;i[0]<N;i[0]++){
		if(N>1){
			for(i[1]=0;i[1]<N;i[1]++){
				if(N>2){
					for(i[2]=0;i[2]<N;i[2]++){
						if(N>3){
							for(i[3]=0;i[3]<N;i[3]++){
								if(N>4){
									for(i[4]=0;i[4]<N;i[4]++){
										if(N>5){
											for(i[5]=0;i[5]<N;i[5]++){
												if(N>6){
													for(i[6]=0;i[6]<N;i[6]++){
														if(N>7){
															for(i[7]=0;i[7]<N;i[7]++){
																if(N>8){
																	for(i[8]=0;i[8]<N;i[8]++){
																		if(N>9){
																			for(i[9]=0;i[9]<N;i[9]++)printf("%c%c%c%c%c%c%c%c%c%c\n",a[i[0]],a[i[1]],a[i[2]],a[i[3]],a[i[4]],a[i[5]],a[i[6]],a[i[7]],a[i[8]],a[i[9]]);
																		}else printf("%c%c%c%c%c%c%c%c%c\n",a[i[0]],a[i[1]],a[i[2]],a[i[3]],a[i[4]],a[i[5]],a[i[6]],a[i[7]],a[i[8]]);
																	}
																}else printf("%c%c%c%c%c%c%c%c\n",a[i[0]],a[i[1]],a[i[2]],a[i[3]],a[i[4]],a[i[5]],a[i[6]],a[i[7]]);
															}
														}else printf("%c%c%c%c%c%c%c\n",a[i[0]],a[i[1]],a[i[2]],a[i[3]],a[i[4]],a[i[5]],a[i[6]]);
													}
												}else printf("%c%c%c%c%c%c\n",a[i[0]],a[i[1]],a[i[2]],a[i[3]],a[i[4]],a[i[5]]);
											}
										}else printf("%c%c%c%c%c\n",a[i[0]],a[i[1]],a[i[2]],a[i[3]],a[i[4]]);
									}
								}else printf("%c%c%c%c\n",a[i[0]],a[i[1]],a[i[2]],a[i[3]]);
							}
						}else printf("%c%c%c\n",a[i[0]],a[i[1]],a[i[2]]);
					}
				}else printf("%c%c\n",a[i[0]],a[i[1]]);
			}
		}else printf("%c\n",a[i[0]]);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:20: error: initializer-string for 'char [10]' is too long [-fpermissive]
    6 |         char a[10]="abcdefghij";
      |                    ^~~~~~~~~~~~
Language: Java

import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    String N1[] = new String[1];
    String N2[] = new String[2];
    String N3[] = new String[5];

if(N==1){
System.out.println("a");");
return;
}
if(N==2){
System.out.println("aa");
System.out.println("ab");
return;
}
if(N==3){
System.out.println("aaa");
System.out.println("aab");
System.out.println("abb");
System.out.println("aba");
System.out.println("abc");
return;
}
if(N==4){
System.out.println("aaaa");
System.out.println("aaab");
System.out.println("aabb");
System.out.println("aaba");
System.out.println("abaa");
System.out.println("abab");
System.out.println("abba");
System.out.println("abbb");
System.out.println("aabc");
System.out.println("abac");
System.out.println("abbc");
System.out.println("abca");
System.out.println("abcb");
System.out.println("abcc");
System.out.println("abcd");
return;
}
if(N==5){
System.out.println("aaaaa");
System.out.println("aaaab");
System.out.println("aaaba");
System.out.println("aaabb");
System.out.println("aabaa");
System.out.println("aabab");
System.out.println("aabba");
System.out.println("aabbb");
System.out.println("abaaa");
System.out.println("abaab");
System.out.println("ababa");
System.out.println("ababb");
System.out.println("abbaa");
System.out.println("abbab");
System.out.println("abbba");
System.out.println("abbbb");
System.out.println("aaabc");
System.out.println("aabac");
System.out.println("aabbc");
System.out.println("aabca");
System.out.println("aabcc");
System.out.println("abaac");
System.out.println("ababc");
System.out.println("abaca");
System.out.println("abacb");
System.out.println("abacc");
System.out.println("abbac");
System.out.println("abbbc");
System.out.println("abbcc");
System.out.println("abccc");
System.out.println("aabcd");
System.out.println("abacd");
System.out.println("abcad");
System.out.println("abcda");
System.out.println("abcde");
return;
}

      
  }
  

  
}

Compiler output:
Main.java:11: error: unclosed string literal
System.out.println("a");");
                        ^
1 error
Language: C++

/*
    アリナ・グレイはかわいい
*/

#include<bits/stdc++.h>
using namespace std;
#define itn int
#define endl "\n"

int main(void){
    int n;
    cin >> n;
    
    if(n == 1)cout << "a";
    else if(n == 2)cout << "aa" << endl << "ab";
    else if(n == 3){
        cout << "aaa" << endl << "aab" << endl << "aba" << endl << "abb" << endl << "abc";
    } else if(n == 4){
        cout << "aaaa" << endl << "aaab" << endl << "aaba" << endl << "aabb" << endl << "aabc" << endl;
        cout << "abbb" << endl << "abcc" << endl << "abcd";
    } else if(n == 5){
        cout << "aaaaa" << endl << "aaaab" << endl << "aaaba" << endl << "aaabb" << endl << "aaabc" << endl << "aabbb" << endl;
        cout << "aabbc" << endl << "aabcc" << endl << "aabcd" << endl << "abbbb" << endl << "abbbc" << endl << "abbcc" << endl << "abccc" << endl;
        cout << "abccd" << endl << "abcdd" << endl << "abcde";
    } else if(n == 6){
        cout << "aaaaaa" << endl << "aaaaab" << endl << "aaaabb" << endl << "aaaabc" << endl << "aaabbb" << endl << "aaabbc" << endl << "aaabcc" << endl << "aaabcd" << endl;
        cout << "aabbbb" << endl << "aabbbc" << endl << "aabbcc" << endl << "aabbcd" << endl << "aabccc" << endl << "aabccd" << endl << "aabcde" << endl << "abbbbb" << endl << "abbbbc" << endl << "abbbcd" << endl
        cout << "abbccd" << endl << "abbcdd" << endl << "abbcde" << endl << "abcccc" << endl << "abcccd" << endl << "abccdd" << endl << "abccde" << endl << "abcddd" << endl << "abcdde" << endl;
        cout << "abcdee" << endl << "abcdef" << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:9: error: expected ';' before 'cout'
   28 |         cout << "abbccd" << endl << "abbcdd" << endl << "abbcde" << endl << "abcccc" << endl << "abcccd" << endl << "abccdd" << endl << "abccde" << endl << "abcddd" << endl << "abcdde" << endl;
      |         ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
	int a;
	cin>>a;
	string b;
	for (int i=0;i<a;i++)
		a+="a";
	for (int i=0;i<a;i++)
	{
		cout<<b;
		b++;
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:18: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
    9 |                 a+="a";
      |                 ~^~~~~
      |                  |
      |                  const char*
a.cc:13:18: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
   13 |                 b++;
      |                 ~^~
Language: Java


import scala.math.Ordering;

import java.util.*;

public class Main {
    int n;
    int[] arr;
    void run() {
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        arr = new int[n];
        dfs(1, 0, 0);
    }

    void dfs(int i, int x, int usedMax) {
        if (i == n) {
            print(arr);
            return;
        }

        for (int j = 0; j <= usedMax + 1; j++) {
            int nx = x + j;
            arr[i] = nx;
            dfs(i + 1, x, Math.max(nx, usedMax));
        }
    }

    void print(int[] arr) {
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < n ;i++) {
            sb.append((char) ('a' + arr[i]));
        }
        System.out.println(sb.toString());
    }

    void debug(Object... os) {
        System.err.println(Arrays.deepToString(os));
    }

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


Compiler output:
Main.java:2: error: package scala.math does not exist
import scala.math.Ordering;
                 ^
1 error
Language: Java


import java.util.Scanner;

public class Main{
	
	static StringBuilder sb = new StringBuilder();

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = Integer.parseInt(sc.next());
		
		dp = new char [n][10];
		sb.append('a');
		
		dfs(1,'1',n);
		
		

	}
	
	static void dfs(int cnt,int now ,int n) {
		
		if(sb.length() == n) {
			System.out.println(sb.toString());
			return;
		}
		boolean flag = false;
		
		for(char i = 'a' ; i <= 'a' + now - '0' ;i++)  {
			if(i == 'a' + now - '0') {
				now++;
				flag = true;
			}
			sb.append(i);
			dfs(cnt ,now , n);
			if(flag) {
				now--;
			}
			sb.deleteCharAt(sb.length()-1);
			
		}
		
	}

}


Compiler output:
Main.java:13: error: cannot find symbol
		dp = new char [n][10];
		^
  symbol:   variable dp
  location: class Main
1 error
Language: C++

#include <iostream>
#include <cmath>
#include <string>
using namespace std;
int n;
int main()
{
  cin >> n;
  if (n == 4)
  {
    cout << "aaaa\n"
         << "aaab\n"
         << "aaba\n"
         << "aabb\n"
         << "aabc\n"
         << "abaa\n"
         << "abab\n"
         << "abba\n"
         << "abbb\n"
         << "abbc\n"
         << "abca\n"
         << "abcb\n"
         << "abcc\n"
         << "abcd\n"
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:21: error: expected ';' before '}' token
   24 |          << "abcd\n"
      |                     ^
      |                     ;
   25 |   }
      |   ~
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
int main(void){

  int N;
  cin >> N;
  
  int keta=0;
  int kaisu=0;
  for(int i=0; i<N; i++){
    kaisu += pow(10,i)*(N-i);
  }
  bool ptn[1000000][N];
  int ptnl=0;
  
  for(int i=0; i<kaisu; i++){
    bool p[N];
    for(
  }

  


  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:3: error: expected primary-expression before '}' token
   20 |   }
      |   ^
a.cc:20:3: error: expected primary-expression before '}' token
a.cc:19:9: error: expected ';' before '}' token
   19 |     for(
      |         ^
      |         ;
   20 |   }
      |   ~      
a.cc:20:3: error: expected primary-expression before '}' token
   20 |   }
      |   ^
a.cc:19:9: error: expected ')' before '}' token
   19 |     for(
      |        ~^
      |         )
   20 |   }
      |   ~      
a.cc:20:3: error: expected primary-expression before '}' token
   20 |   }
      |   ^
Language: C++

#import math

a, b, c = map(int, input().split())
a *= 1000000000000
b *= 1000000000000
c *= 1000000000000

if a**0.5 + b**0.5 < c**0.5:
    print("Yes")
else:
    print("No")

Compiler output:
a.cc:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    1 | #import math
      |  ^~~~~~
a.cc:1:9: error: #import expects "FILENAME" or <FILENAME>
    1 | #import math
      |         ^~~~
a.cc:3:1: error: 'a' does not name a type
    3 | a, b, c = map(int, input().split())
      | ^
Language: C++

import math
a,b,c=map(int,input().split())
if sqrt(a) + sqrt(b) < sqrt(c):
    print("Yes")
else:
    print("No")

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import math
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n;
char s[20];
dfs(ll wei)
{
	if(wei==n)
	{
		puts(s);
	}
	else
	{
		char ma='a';
		for(ll i=0;i<wei;i++)
		{
			ma=max(ma,s[i]);
		}
		for(ll i='a';i<=ma+1;i++)
		{
			s[wei]=i;
			dfs(wei+1);
		}
	}
}
int main(void)
{
	scanf("%lld",&n);
	for(ll i=0;i<n;i++)
	{
		s[i]='a';
	}
	s[n]='\0';
	dfs(1);
}

Compiler output:
a.cc:6:1: error: ISO C++ forbids declaration of 'dfs' with no type [-fpermissive]
    6 | dfs(ll wei)
      | ^~~
a.cc: In function 'int dfs(ll)':
a.cc:25:1: warning: no return statement in function returning non-void [-Wreturn-type]
   25 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int N;
string S;
void dfs(int a,int b)
{
  if(a==N)
  {
    puts(S.c_str());
    return ;
  }
  for(int i=0;i<=b+1;i++)
  {
    S[a]='a'+i;
    dfs(a+1,max(b,i));
  }
  return ;
}
int main()
{
  cin>>N;
  dfs(0,-1);
  return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:23:12: error: expected '}' at end of input
   23 |   return 0;
      |            ^
a.cc:20:1: note: to match this '{'
   20 | {
      | ^
Language: C++

#include "stdafx.h"
#include <bits/stdc++.h>
#define f(i,n) for(int i=0;i<n;i++)
#define P pair<int,int>
#define F first
#define S second
#define int long long
#define mod 1000000007
#define mmod 998244353
#define all(v) v.begin(), v.end()
using namespace std;
int mypow(int a, int b, int c) {
	if (b == 0)return 1;
	if (b % 2)return mypow(a, b - 1, c)*a%c;
	int z = mypow(a, b / 2, c);
	return z * z%c;
}
void mutu(int n,int z,string s) {
	if (n == 0) {
		cout << s << endl;
		return;
	}
	else {
		f(i, z + 2) {
			mutu(n - 1, i,s+char('a'+i));
		}
	}
}
signed main() {
	int n;
	cin >> n;
	mutu(n - 1, 0, "a");
}


Compiler output:
a.cc:1:10: fatal error: stdafx.h: No such file or directory
    1 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<iostream>
#include<map>
#include<set>
using namespace std;
typedef long long ll;
ll n;
char s[20];
dfs(ll wei)
{
	if(wei==n)
	{
		printf("%s\n",s);
	}
	else
	{
		char ma='a';
		for(ll i=0;i<wei;i++)
		{
			ma=max(ma,s[i]);
		}
		for(ll i='a';i<=ma+1;i++)
		{
			s[wei]=i;
			dfs(wei+1);
		}
	}
}
int main(void)
{
	scanf("%lld",&n);
	for(ll i=0;i<n;i++)
	{
		s[i]='a';
	}
	s[n]='\0';
	dfs(1);
}

Compiler output:
a.cc:12:1: error: ISO C++ forbids declaration of 'dfs' with no type [-fpermissive]
   12 | dfs(ll wei)
      | ^~~
a.cc: In function 'int dfs(ll)':
a.cc:31:1: warning: no return statement in function returning non-void [-Wreturn-type]
   31 | }
      | ^
Language: C++

#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define PB push_back
#define MP make_pair
#define ll long long

inline int toInt(string s){int v;istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x){ostringstream sout;sout<<x;return sout.str();}

int main(){
    std::ios::sync_with_stdio(false);
    ll a, b, c;
    cin >> a >> b >> c;

    cout << (2 * sqrt(a * b) < c - a - b) ? "Yes" : "No") << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:57: error: expected ';' before ')' token
   39 |     cout << (2 * sqrt(a * b) < c - a - b) ? "Yes" : "No") << endl;
      |                                                         ^
      |                                                         ;
Language: C++

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

using vint = vector<int>;

int main() {
    string a, b, c;
    cin >> a >> b >> c;
    int la = a.size(), lb = b.size(), lc = c.size();
    int ans = la + lb + lc;

    auto compstr = [&](string &a, string &b, int lc) {
        int la = a.size(), lb = b.size();
        vint ab(la);
        for (int i = 0; i < la; i++) {
            int flag = 1;
            for (int j = 0; j < lb && i + j < la; j++)
                if (a[i + j] != '?' && b[j] != '?' && a[i + j] != b[j]) {
                    flag = 0;
                    break;
                }
            if (!flag) continue;
            ab[i] = 1;
            ans = min(ans, max(la, i + lb) + lc);
        }
        return ab;
    };
    vint ab = compstr(a, b, lc), ac = compstr(a, c, lb),
         ba = compstr(b, a, lc), bc = compstr(b, c, la),
         ca = compstr(c, a, lb), cb = compstr(c, b, la);
    auto checkstr = [&](vint &ab, vint &bc, vint &ac, int lc) {
        int la = ab.size(), lb = bc.size();
        for (int i = 0; i < la; i++) {
            if (!ab[i])
                continue;
            for (int j = 0; j < lb || i + j < la); j++) {
                if (j < lb && !bc[j])
                    continue;
                if (i + j < la && !ac[i + j])
                    continue;
                ans = min(ans, max(la, max(i + lb, i + j + lc)));
            }
        }
    };
    checkstr(ab, bc, ac, lc);
    checkstr(ac, cb, ab, lb);
    checkstr(ba, ac, bc, lc);
    checkstr(bc, ca, ba, la);
    checkstr(ca, ab, cb, lb);
    checkstr(cb, ba, ca, la);

    cout << ans;
}

Compiler output:
a.cc: In lambda function:
a.cc:36:49: error: expected ';' before ')' token
   36 |             for (int j = 0; j < lb || i + j < la); j++) {
      |                                                 ^
      |                                                 ;
a.cc:36:52: error: 'j' was not declared in this scope
   36 |             for (int j = 0; j < lb || i + j < la); j++) {
      |                                                    ^
Language: C++

 #include <iostream>
 #include <string>

 using namespace std;

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

 #define M 2000

 bool ab[100000],ac[100000],bc[100000];

 bool match(char c1, char c2){
 return (c1 == ’?’ || c2 == ’?’ || c1 == c2);
 }

int main(void){
 int i,j;

 string a,b,c;
 cin >> a >> b >> c;

 int A = a.length();
 int B = b.length();
 int C = c.length();

 REP(i,A) REP(j,B) if(!match(a[i], b[j])) ab[i-j+50000] = true;
 REP(i,A) REP(j,C) if(!match(a[i], c[j])) ac[i-j+50000] = true;
 REP(i,B) REP(j,C) if(!match(b[i], c[j])) bc[i-j+50000] = true;

 int ans = 3 * M;
 for(i=-2*M;i<=2*M;i++) for(j=-2*M;j<=2*M;j++) if(!ab[i+50000] && !ac[j+50000] &&
!bc[j-i+50000]){
 int L = min(0, min(i, j));
 int R = max(A, max(B + i, C + j));
 ans = min(ans, R - L);
 }

 cout << ans << endl;

 return 0;
 }

Compiler output:
a.cc:13:16: error: extended character ’ is not valid in an identifier
   13 |  return (c1 == ’?’ || c2 == ’?’ || c1 == c2);
      |                ^
a.cc:13:18: error: extended character ’ is not valid in an identifier
   13 |  return (c1 == ’?’ || c2 == ’?’ || c1 == c2);
      |                  ^
a.cc:13:29: error: extended character ’ is not valid in an identifier
   13 |  return (c1 == ’?’ || c2 == ’?’ || c1 == c2);
      |                             ^
a.cc:13:31: error: extended character ’ is not valid in an identifier
   13 |  return (c1 == ’?’ || c2 == ’?’ || c1 == c2);
      |                               ^
a.cc: In function 'bool match(char, char)':
a.cc:13:16: error: '\U00002019' was not declared in this scope
   13 |  return (c1 == ’?’ || c2 == ’?’ || c1 == c2);
      |                ^
a.cc:13:44: error: expected ':' before ')' token
   13 |  return (c1 == ’?’ || c2 == ’?’ || c1 == c2);
      |                                            ^
      |                                            :
a.cc:13:44: error: expected primary-expression before ')' token
a.cc:13:44: error: expected ':' before ')' token
   13 |  return (c1 == ’?’ || c2 == ’?’ || c1 == c2);
      |                                            ^
      |                                            :
a.cc:13:44: error: expected primary-expression before ')' token
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<cstdlib>
template<typename T>
void fin(T const& t){ std::cout << t << std::endl; exit(0); }

std::string concat(std::string const& a, std::string const& b) {
  for(int i = 0; i < a.size(); ++i) {
    std::string res = a.substr(0, i);
    res.reserve(i+b.size()+1);
    for(int j = 0; j < b.size() && i+j < a.size(); ++j) {
      if(b[j] == '?') res += a[i+j];
      else if(a[i+j] == '?' || a[i+j] == b[j]) res += b[j];
      else break;
    }
    if(res.size() == i + b.size()) return res;
    else if(res.size() == a.size()) return res + b.substr(a.size()-i);
  }
  return a+b;
}

int main() {
  std::string a, b, c; std::cin >> a >> b >> c;
  size_t ans = a.size()+b.size()+c.size();
  ans = std::min(ans, concat(a, concat(b, c)).size());
  ans = std::min(ans, concat(a, concat(c, b)).size());
  ans = std::min(ans, concat(b, concat(a, c)).size());
  ans = std::min(ans, concat(b, concat(c, a)).size());
  ans = std::min(ans, concat(c, concat(a, b)).size());
  ans = std::min(ans, concat(c, concat(b, a)).size());
  fin(ans);
  return 0;


Compiler output:
a.cc: In function 'int main()':
a.cc:33:12: error: expected '}' at end of input
   33 |   return 0;
      |            ^
a.cc:23:12: note: to match this '{'
   23 | int main() {
      |            ^
Language: C++

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

int main()
{
vector<string> v(3);
cin >> v[0] >> v[1] >> v[2] ;
sort(v.begin(),v.end());
do{
bool a[v[0].size()+1]={};
bool b[v[0].size()+1]={};
bool c[v[0].size()]={};
rep(i,v[0].size())rep(j,v[1].size())if(i+j<v[0].size()&&v[0][i+j]!='?'&&v[1][j]!='?'&&v[0][i+j]!=v[1][j]){a[i]=1;break;}
rep(i,v[0].size())rep(j,v[2].size())if(i+j<v[0].size()&&v[0][i+j]!='?'&&v[2][j]!='?'&&v[0][i+j]!=v[2][j]){b[i]=1;break;}
rep(i,v[1].size())rep(j,v[2].size())if(i+j<v[1].size()&&v[1][i+j]!='?'&&v[2][j]!='?'&&v[1][i+j]!=v[2][j]){c[i]=1;break;}
rep(i,v[0].size()+1)rep(j,v[1].size()+1){
  if(!a[i]&&!b[i+j]&&!c[j])ans=min(ans,(ll)max({v[0].size(),v[1].size()+i,v[2].size()+i+j}));
}
}while(next_permutation(v.begin(),v.end()));
cout << ans << endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:47: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
   20 |   if(!a[i]&&!b[i+j]&&!c[j])ans=min(ans,(ll)max({v[0].size(),v[1].size()+i,v[2].size()+i+j}));
      |                                            ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   template argument deduction/substitution failed:
a.cc:20:47: note:   deduced conflicting types for parameter '_Tp' ('long unsigned int' and 'long long unsigned int')
   20 |   if(!a[i]&&!b[i+j]&&!c[j])ans=min(ans,(ll)max({v[0].size(),v[1].size()+i,v[2].size()+i+j}));
      |                                            ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   candidate expects 2 arguments, 1 provided
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <algorithm>

const int upper_bound_length = 2000;
std::string a, b, c;
int length_a, length_b, length_c;
int min_length_s = 0;

// i-j+50000 element(0-based) means that assignment where a[i] and b[j] are match is contradict.
bool ab[100000], bc[100000], ac[100000];

bool match(char c1, char c2) {
  return c1 == '?' || c2 == '?' || c1 == c2;
}

int main() {
  std::cin >> a >> b >> c;
  length_a = a.length;
  length_b = b.length;
  length_c = c.length;
  for (int i = 0; i <= length_a; ++i) {
    for (int j = 0; j <= length_b; ++j) {
      if (!match(a[i], b[j])) ab[i-j+50000] = true;
    }
  }
  for (int i = 0; i <= length_b; ++i) {
    for (int j = 0; j <= length_c; ++j) {
      if (!match(b[i], c[j])) bc[i-j+50000] = true;
    }
  }
  for (int i = 0; i <= length_a; ++i) {
    for (int j = 0; j <= length_c; ++j) {
      if (!match(a[i], c[j])) ac[i-j+50000] = true;
    }
  }
  for (int i = -2*upper_bound_length; i <= 2*upper_bound_length; ++i) {
    for (int j = -2*upper_bound_length; j <= 2*upper_bound_length; ++j) {
      if (!ab[i+50000] && !bc[i-j+50000] && !ac[j+50000]) {
        int L = std::min(0, std::min(i, j));
        int R = std::max(length_a, std::min(length_b + i, length_c + j));
        min_length_s = std::min(min_length_s, R - L);
      }
    }
  }

  std::cout << min_length_s << std::endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:16: error: cannot convert 'std::__cxx11::basic_string<char>::length' from type 'std::__cxx11::basic_string<char>::size_type (std::__cxx11::basic_string<char>::)() const noexcept' {aka 'long unsigned int (std::__cxx11::basic_string<char>::)() const noexcept'} to type 'int'
   21 |   length_a = a.length;
      |                ^~~~~~
a.cc:22:16: error: cannot convert 'std::__cxx11::basic_string<char>::length' from type 'std::__cxx11::basic_string<char>::size_type (std::__cxx11::basic_string<char>::)() const noexcept' {aka 'long unsigned int (std::__cxx11::basic_string<char>::)() const noexcept'} to type 'int'
   22 |   length_b = b.length;
      |                ^~~~~~
a.cc:23:16: error: cannot convert 'std::__cxx11::basic_string<char>::length' from type 'std::__cxx11::basic_string<char>::size_type (std::__cxx11::basic_string<char>::)() const noexcept' {aka 'long unsigned int (std::__cxx11::basic_string<char>::)() const noexcept'} to type 'int'
   23 |   length_c = c.length;
      |                ^~~~~~
Language: Java

import java.util.*;
public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		String buf,as,bs,cs,ass,bss,css;
		String a = sc.next();
		String b = sc.next();
		String c = sc.next();
		int allLen = a.length() + b.length() + c.length();
		String ans;
		as = MatchingStr(a,b);
		bs = MatchingStr(a,c);
		cs = MatchingStr(b,c);
		ass = MatchingStr(as,bs);
		bss = MatchingStr(bs,cs);
		css = MatchingStr(as,cs);
		ans = retsho(retsho(ass,bss,allLen),css,allLen)
		System.out.println(ans.length());
	}
	public static String MatchingStr(String str1,String str2){
		String lon,sho,lonhead,lontail,str;
		int len1 = str1.length();
		int len2 = str2.length();
		int i;
		String buf,head,tail;
		if(len1 > len2){
			lon = str1;
			sho = str2;
		}else{
			lon = str2;
			sho = str1;
		}
		if(lon.length() == sho.length() && PatternMatches(lon,sho)){
			if(sho.contains("?")){
				return lon;
			}else{
				return sho;
			}
		}
		for(i = 1;i < (lon.length() - sho.length());i++){
			buf = lon.substring(i,i + sho.length());
			if(PatternMatches(sho,buf)){
				str = lon.substring(0,i) + sho + lon.substring(i + sho.length(),lon.length());
				return str;
			}
		}
		for(i = 0;i < sho.length();i++){
			head = sho.substring(i,sho.length());
			tail = sho.substring(0,sho.length() - i);
			lonhead = lon.substring(0,sho.length() - i);
			lontail = lon.substring(lon.length() - sho.length() + i,lon.length());
			if(PatternMatches(lonhead,head)){
				buf = sho.substring(0,i);
				return buf + lon;
			}else if(PatternMatches(tail,lontail)){
				buf = sho.substring(sho.length() - i,sho.length());
				return lon + buf;
			}
		}
		return lon + sho;
	}
	public static String retsho(String str1,String str2,int alllength){
		int str1len = alllength - str1.length();
		int str2len = alllength - str2.length();
		if(str1len > str2len){
			return str1;
		}else{
			return str2;
		}
	} 
	public static boolean PatternMatches(String str1,String str2){
		for(int i = 0;i < str1.length();i++){
			if(str1.charAt(i) != str2.charAt(i) && str1.charAt(i) != '?' && str2.charAt(i) != '?'){
				return false;
			}
		}
		return true;
	}
}


Compiler output:
Main.java:17: error: ';' expected
		ans = retsho(retsho(ass,bss,allLen),css,allLen)
		                                               ^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//typedef pair<ll, ll> P;
typedef pair<int, int> i_i;

#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define REP(i,n) reps(i,0,n)
#define ALL(v) v.begin(), v.end()
#define SZ(x) ((int)((x).size()))

const double PI  = acos(-1.0);
const double EPS = 1e-9;
const ll INF = 1e9+10;
const ll mod = 1e9+7;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
#define print(x) cerr << #x << " is " << x << endl;
//#define print(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl; 

bool ab[50000], bc[50000], ca[50000];

match(char x, char y){
    if (x == y || x == '?' || y == '?')return 1;
    return 0;
}
int main() {
    string A, B, C;
    cin >> A >> B >> C;
    int ans = INF;
    
    rep(i, SZ(A))rep(j, SZ(B))if (!match(A[i], B[j]))ab[10000 + i - j] = true;
    rep(i, SZ(B))rep(j, SZ(C))if (!match(B[i], C[j]))bc[10000 + i - j] = true;
    rep(i, SZ(C))rep(j, SZ(A))if (!match(C[i], A[j]))ca[10000 + i - j] = true;
    
    for (int i = -4000; i <= 4000; i++)for (int j = -4000; j <= 4000; j++){
        if (!ab[10000 + 0 - i] && !bc[10000 + i - j] && !ca[10000 + j - 0]){
            int lb = min(0, min(i, j));
            int ub = max(SZ(A), max(i + SZ(B), j + SZ(C)));
            chmin(ans, ub - lb);
        }
    }
    
    cout << ans;
    return 0;
}


Compiler output:
a.cc:24:1: error: ISO C++ forbids declaration of 'match' with no type [-fpermissive]
   24 | match(char x, char y){
      | ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//typedef pair<ll, ll> P;
typedef pair<int, int> i_i;

#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define REP(i,n) reps(i,0,n)
#define ALL(v) v.begin(), v.end()
#define SZ(x) ((int)(x).size())

const double PI  = acos(-1.0);
const double EPS = 1e-9;
const ll INF = 1e9+10;
const ll mod = 1e9+7;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
#define print(x) cerr << #x << " is " << x << endl;
//#define print(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl; 

bool ab[50000], bc[50000], ca[50000];

match(char x, char y){
    if (x == y || x == '?' || y == '?')return 1;
    return 0;
}
int main() {
    string A, B, C;
    cin >> A >> B >> C;
    int ans = INF;
    
    rep(i, SZ(A))rep(j, SZ(B))if (!match(A[i], B[j]))ab[10000 + i - j] = true;
    rep(i, SZ(B))rep(j, SZ(C))if (!match(B[i], C[j]))bc[10000 + i - j] = true;
    rep(i, SZ(C))rep(j, SZ(A))if (!match(C[i], A[j]))ca[10000 + i - j] = true;
    
    for (int i = -4000; i <= 4000; i++)for (int j = -4000; j <= 4000; j++){
        if (!ab[10000 + 0 - i] && !bc[10000 + i - j] && !ca[10000 + j - 0]){
            int lb = min(0, min(i, j));
            int ub = max(SZ(A), max(i + SZ(B), j + SZ(C)));
            chmin(ans, ub - lb);
        }
    }
    
    cout << ans;
    return 0;
}


Compiler output:
a.cc:24:1: error: ISO C++ forbids declaration of 'match' with no type [-fpermissive]
   24 | match(char x, char y){
      | ^~~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
using namespace std;
typedef long long ll;
string unite(string s,string t){
  ll min_l=174417441744,min_pos=s.length();
  for(int i=0;i<s.length();i++){
    bool f=true;
    for(int j=0;j<t.length()&&i+j<s.length();j++){
      if(s[i+j]=='?'||t[j]=='?') continue;
      if(s[i+j]!=t[j]){
        f=false;
        break;
      }
    }
    if(f){
      string ns;
      for(int k=0;k<i;k++) ns.push_back(s[k]);
      for(int k=0;k<t.length()||i+k<s.length();k++){
        if(k<t.length()) {
          if(i+k<s.length()){
            if(s[i+k]=='?') res.push_back(t[k]);
            else res.push_back(s[i+k]);
          }
          else res.push_back(t[k]);
        }
        else res.push_back(s[i+k]);
      }
      if(ns.length()<min_l){
        min_l=ns.length();
        min_pos=i;
      }
    }
  }
  string res;
  ll i=min_pos;
  for(int k=0;k<i;k++) res.push_back(s[k]);
  for(int k=0;k<t.length()||i+k<s.length();k++){
    if(k<t.length()) {
      if(i+k<s.length()){
        if(s[i+k]=='?') res.push_back(t[k]);
        else res.push_back(s[i+k]);
      }
      else res.push_back(t[k]);
    }
    else res.push_back(s[i+k]);
  }
  return res;
}
ll solve(string a,string b,string c){
  string d=unite(a,b);
  string e=unite(d,c),f=unite(c,d);
//  cout<<"D:"<<d<<endl<<"E:"<<e<<endl<<"F:"<<f<<endl;
//  cout<<"DL:"<<d.length()<<" EL:"<<e.length()<<" FL:"<<f.length()<<endl;
  string g=unite(b,a);
  string h=unite(g,c),i=unite(c,g);
  return min({e.length(),f.length(),h.length(),i.length()});
}
int main(){
  string a,b,c;
  cin>>a>>b>>c;
  ll ans=solve(a,c,b);
  ans=min(ans,solve(a,b,c));
  ans=min(ans,solve(b,a,c));
  ans=min(ans,solve(b,c,a));
  ans=min(ans,solve(c,a,b));
  ans=min(ans,solve(c,b,a));
  cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'std::string unite(std::string, std::string)':
a.cc:24:29: error: 'res' was not declared in this scope
   24 |             if(s[i+k]=='?') res.push_back(t[k]);
      |                             ^~~
a.cc:25:18: error: 'res' was not declared in this scope
   25 |             else res.push_back(s[i+k]);
      |                  ^~~
a.cc:27:16: error: 'res' was not declared in this scope
   27 |           else res.push_back(t[k]);
      |                ^~~
a.cc:29:14: error: 'res' was not declared in this scope
   29 |         else res.push_back(s[i+k]);
      |              ^~~
Language: C++

#include <iostream>
#include <string>
#include <vector>

using namespace std;
#define M 2005
bool d[3][3][M];

int max(int a, int b){
    if (a > b) return a;
    return b;
}
int ans = M * 3;
void check(string a, string b, string c){
    vector <string> s;
    s.push_back(a);
    s.push_back(b);
    s.push_back(c);
    
    int i, j, k;
    for (i=0;i<3;i++)
        for(j=0;j<3;j++)
            for(k=0;k<s[i].size();k++){
                if (i>= j) continue;
                bool ok = true;
                for (int ni =k; ni<s[i].size();ni++){
                    int nj = ni - k;
                    if (nj > s[j].size()) break;
                    if (s[i][ni]=='?' || s[j][nj]=='?') continue;
                    if (s[i][ni] != s[j][nj]) ok = false;
                }
                d[i][j][k] = ok;
            }
    for (i=0;i<M;i++)
        for (j=0;j < M;j++){
            if (i < s[0].size() && !d[0][1][i]) continue;
            if (j < s[1].size() && !d[1][2][j]) continue;
            if (i+j < s[0].size() && !d[0][2][i+j]) continue;
            int now = 0;
            now = max(now, (int)s[0].size());
            now = max(now, i + (int)s[1].size());
            now = max(now, i + j + (int)s[2].size());
            ans = min(ans, now);
        }
}


int main()
{
    int i;
    vector<string> s(3);
    for (i=0;i<3;i++)
        cin >> s[i];
    
    sort(s.begin(), s.end());
    
    check(s[0], s[1], s[2]);
    check(s[0], s[2], s[1]);
    check(s[1], s[0], s[2]);
    check(s[1], s[2], s[0]);
    check(s[2], s[0], s[1]);
    check(s[2], s[1], s[0]);
    
    cout << ans<<endl;
    return 0;
}


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

a = input()
b = input()
c = input()

A = len(a)
B = len(b)
C = len(c)

def judge(s, t):
	X = [0] * 20000
	ns, nt = len(s), len(t)
	for i in range(ns):
		for j in range(nt):
			if s[i] != t[j] and s[i] != '?' and t[j] != '?':
				X[i-j+8000] = 1
	return X

ab = judge(a, b)
bc = judge(b, c)
ac = judge(a, c)
r = A + B + C
for i in range(-4000, 4001):
	for j in range(-4000, 4001):
		if (not ab[i+8000]) and (not ac[j+8000]) and (not bc[j-i+8000]):
			st = min(i, j, 0)
			en = max(i+B, j+C, A)
			r = min(en-st, r)
print(r)

Compiler output:
a.cc:1:1: error: 'a' does not name a type
    1 | a = input()
      | ^
Language: C++

#include <algorithm>
#include <climits>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

//std::cout << std::fixed << std::setprecision(10)
constexpr long long MOD = 1000000007;

int dx[] = { 0, 1, 0, -1};
int dy[] = {-1, 0, 1,  0};

size_t solve1(const std::string& x, const std::string& y)
{
  size_t ans = x.size() + y.size();
  for(size_t i = 0; i < x.size(); ++i)
  {
    bool matched = true;
    for(size_t j = 0; j < std::min(y.size(), x.size() - i); ++j)
    {
      char a = x[j + i];
      char b = y[j];
      if(a != '?' && b != '?' && a != b)
      {
        matched = false;
        break;
      }
    }
    if(matched)
    {
      ans = std::min(ans, std::max(x.size(), i + y.size()));
      break;
    }
  }
  return ans;
}

size_t solve(const std::string& a, const std::string& b, const std::string& c)
{
  std::string str;
  size_t ans = a.size() + b.size() + c.size();
  str.reserve(a.size() + b.size());
  for(size_t i = 0; i < a.size(); ++i)
  {
    for(size_t j = 0; j < i; ++j)
      str.push_back(a[j]);
    for(size_t j = 0; j < std::min(b.size(), a.size() - i); ++j)
    {
      char x = a[j + i];
      char y = b[j];
      if(x != '?' && y != '?')
      {
        if(x == y)
          str.push_back(x);
        else
        {
          str.clear();
          break;
        }
      }
      else if (x != '?' && y == '?')
        str.push_back(x);
      else if (x == '?' && y != '?')
        str.push_back(y);
      else
        str.push_back(x);
    }
    if(str.size())
    {
      if(a.size() < i + b.size())
      {
        for(size_t j = a.size() - i; j < b.size(); ++j)
          str.push_back(b[j]);
      }
      ans = std::min(ans, solve1(str, c));
      ans = std::min(ans, solve1(c, str));
    }
    str.clear();
  }
  for(auto x: a)
    str.push_back(x);
  for(auto x: b)
    str.push_back(x);
  ans = std::min(ans, solve(str, c));
  ans = std::min(ans, solve1(c, str));
  return ans;
}

int main()
{
  std::string a,b,c;
  std::cin >> a >> b >> c;
  size_t ans = solve(a, b, c);
  ans = std::min(ans, solve(b, a, c));
  ans = std::min(ans, solve(a, c, b));
  ans = std::min(ans, solve(c, a, b));
  std::cout << ans << std::endl;
  return 0;
}



Compiler output:
a.cc: In function 'size_t solve(const std::string&, const std::string&, const std::string&)':
a.cc:94:28: error: too few arguments to function 'size_t solve(const std::string&, const std::string&, const std::string&)'
   94 |   ans = std::min(ans, solve(str, c));
      |                       ~~~~~^~~~~~~~
a.cc:48:8: note: declared here
   48 | size_t solve(const std::string& a, const std::string& b, const std::string& c)
      |        ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using LL = long long;
#define REP(i,n) for((i)=0;(i)<(int)(n);(i)++) 
#define M 2000
bool ab[100000],bc[100000],ac[100000] ;
bool match(char c1 , char c2) {
   return(c1=='?' || c2=='?' || c1==c2);
}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    string a,b,c ;
    cin >> a >> b >> c ;
    int i,j;
   int A=a.length();
   int B=b.length();
   int C=c.length();
   REP(i,A) REP(j,B) if(!match(a[i],b[j])) ab[i-j+50000] = true ;
   REP(i,A) REP(j,B) if(!match(b[i],c[j])) bc[i-j+50000] = true ;
   REP(i,A) REP(j,B) if(!match(a[i],c[j])) ac[i-j+50000] = true ;
   int ans = 3*M ;
   for(i=-2*M;i<=2*M;i++) for(j=-2*M;j<=2*M;j++) if(!ab[i+50000] && !ac[j+50000] &&
   !bc[j-i+50000]){
   int l = min(0, min(i, j));
   int r = max(A, max(B + i, C + j));
   ans=min(ans, r-l);
   cout<<ans<<endl ;                    
   return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:2: error: expected '}' at end of input
   30 | }
      |  ^
a.cc:10:12: note: to match this '{'
   10 | int main() {
      |            ^