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

int main()
{
	string str;

	cin >> str;

	int l = str.length() -1;

	l /= 2;

	for (int i = l ; i >= 0; i--)
	{
		string A, B;


		A = str.substr(0, i);
		B = str.substr(i, i);
		if (A == B)
		{
			cout << i * 2 << endl;
			return 0;
		}
	}
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:3:9: error: 'string' was not declared in this scope
    3 |         string str;
      |         ^~~~~~
a.cc:5:9: error: 'cin' was not declared in this scope
    5 |         cin >> str;
      |         ^~~
a.cc:5:16: error: 'str' was not declared in this scope; did you mean 'std'?
    5 |         cin >> str;
      |                ^~~
      |                std
a.cc:13:23: error: expected ';' before 'A'
   13 |                 string A, B;
      |                       ^~
      |                       ;
a.cc:16:17: error: 'A' was not declared in this scope
   16 |                 A = str.substr(0, i);
      |                 ^
a.cc:17:17: error: 'B' was not declared in this scope
   17 |                 B = str.substr(i, i);
      |                 ^
a.cc:20:25: error: 'cout' was not declared in this scope
   20 |                         cout << i * 2 << endl;
      |                         ^~~~
a.cc:20:42: error: 'endl' was not declared in this scope
   20 |                         cout << i * 2 << endl;
      |                                          ^~~~
Language: C++

#include<stdio.h>
#include<string.h>
char a[220];
int main(){
	gets(a);
	int s=strlen(a),head,end,sum,i,ans=0,j;
	for(i=0;i<s;i++){
		if(a[i]==a[i+1]){
			sum=0;
			head=i,end=i+1;
			while(a[head]==a[end]&&head>0&&end<s-1){
				sum+=2;
				head--;end++;
			}
			if(ans<sum)
				ans=sum;
		}
	}
	for(i=0;i<s;i++){
		for(j=i+1;j<s;j++){
			if(a[i]==a[j]){
				sum=0;
				head=i,end=j;
				while(a[head]==a[end]&&end<s-1&&head<j){
					sum+=2;head++,end++;
				}
				if(ans<sum&&j==head)
					ans=sum;
			}
		}
	}
	printf("%d\n",ans);
	return 0;
}

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

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

int main (void)
{
    char input[201];
    char a[100], b[100];
    int i,j,l;
    int check;
    int ans;

    cin >> input ;
    l = strlen(input);

    while(1){
        j = 0;
        //aにコピー
        for(i = 0; i <= (l-2)/2; l++){
            a[j] = input[i];
            j++;
        }
        a[j] = '\0';
        j = 0;
        //bにコピー
        for(i = (l-2)/2 + 1; i <= l-1; i++){
            b[j] = input[i];
            j++;
        }
        b[j] = '\0';
        j = 0;

        //偶文字列かどうか
        check = strcmp(a, b);
        if(check == 0){
            ans = strlen(a)*2;
            break;
        }

        l = l-2; 

    }

    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: 'strlen' was not declared in this scope
   14 |     l = strlen(input);
      |         ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <string>
a.cc:34:17: error: 'strcmp' was not declared in this scope
   34 |         check = strcmp(a, b);
      |                 ^~~~~~
a.cc:34:17: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C

#include<stdio.h>
#include<string.h>
int　main(){
char str[222];
scanf("%s",str);
int n= strlen (str); 
for (int i=n-2; i ; i-=2){
if(strncmp (str , str+i/2,i/2) ==0){
printf("%d\n",i);
return0;
}
    }
return = 0;
 }

Compiler output:
main.c:3:4: error: stray '\343' in program
    3 | int<U+3000>main(){
      |    ^~~~~~~~
main.c: In function 'main':
main.c:10:1: error: 'return0' undeclared (first use in this function)
   10 | return0;
      | ^~~~~~~
main.c:10:1: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:8: error: expected expression before '=' token
   13 | return = 0;
      |        ^
Language: C++

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

int main()
{
	string s;
	cin>>s;
	while(!s.empty()){
		int len=strlen(s);
		if(s.substr(0,len/2)==s.substr(len/2,len) and len%2==0)break;
		s.pop_back();
	}
	cout<<s.length()<<endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:9:32: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
    9 |                 int len=strlen(s);
      |                                ^
      |                                |
      |                                std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:1:
/usr/include/string.h:407:35: note:   initializing argument 1 of 'size_t strlen(const char*)'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
Language: C++

#include <iostream>
using namespace std;

int main() {
    string s;
    cin >> s;

    for (int deleted { 1 }; i < s.length(); ++deleted) {
        const int len { s.length() - deleted };
        if (len % 2 != 0) continue;

        const int half { len / 2 };
        int iterator { 0 };
        while (iterator < half) {
            if (s[iterator] != s[iterator + half]) break;
        }
        if (iterator == half) {
            cout << deleted << endl;
            return 0;
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:29: error: 'i' was not declared in this scope
    8 |     for (int deleted { 1 }; i < s.length(); ++deleted) {
      |                             ^
a.cc:9:36: warning: narrowing conversion of '(s.std::__cxx11::basic_string<char>::length() - ((std::__cxx11::basic_string<char>::size_type)deleted))' from 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} to 'int' [-Wnarrowing]
    9 |         const int len { s.length() - deleted };
      |                         ~~~~~~~~~~~^~~~~~~~~
Language: Java

import java.io.PrintWriter; 
import java.util.Scanner; 
  
public class Main { 
 static Scanner in; 
 static PrintWriter out; 
 static void solve() { 
  String S = in.next(); 
  if (S.length() == 2) { 
   System.out.println(0); 
   return; 
  } 
  for(int i = 0; i < S.length(); i++) { 
   S = S.substring(0, S.length() - 2); 
   String first = S.substring(0, S.length()/2); 
   String second = S.substring(S.length()/2); 
   if (first.equals(second)) { 
    System.out.println(S.length()); 
    return; 
   } 
  }    
 } 
 public static void main(String[] args) { 
  in = new Scanner(System.in); 
  out = new PrintWriter(System.out); 
  solve(); 
  out.flush(); 
  out.close(); 
  in.close(); 
 }

Compiler output:
Main.java:30: error: reached end of file while parsing
 }
  ^
1 error
Language: C

# include < stdio .h >
# include < string .h >
int main () {
char str [222];
scanf ("%s", str ) ;
int n= strlen (str ) ;
for (int i=n -2; i; i -=2) {
if( strncmp (str , str +i/2 , i/2) ==0) {
printf ("%d\n" ,i) ;
return 0;
}
}
return 0;
}

Compiler output:
main.c:1:11: fatal error:  stdio .h : No such file or directory
    1 | # include < stdio .h >
      |           ^~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(void) {
  string s;
  cin >> s;

  int sz, size = s.size();
  for (int i = 2; i <= size; i += 2) {
    s = s.substr(0, s.size() - 2);
    sz = s.size() / 2;
    if (s.substr(0, sz) == s.substr(sz, sz)) {
      cout << size - i << endl;
      return 0;
    }
  }

  return 0;
}#include <bits/stdc++.h>

using namespace std;

int main(void) {
  string s;
  cin >> s;

  int sz, size = s.size();
  for (int i = 2; i <= size; i += 2) {
    s = s.substr(0, s.size() - 2);
    sz = s.size() / 2;
    if (s.substr(0, sz) == s.substr(sz, sz)) {
      cout << size - i << endl;
      return 0;
    }
  }

  return 0;
}

Compiler output:
a.cc:20:2: error: stray '#' in program
   20 | }#include <bits/stdc++.h>
      |  ^
a.cc:20:3: error: 'include' does not name a type
   20 | }#include <bits/stdc++.h>
      |   ^~~~~~~
a.cc:24:5: error: redefinition of 'int main()'
   24 | int main(void) {
      |     ^~~~
a.cc:5:5: note: 'int main()' previously defined here
    5 | int main(void) {
      |     ^~~~
Language: C++

#include <iostream>
using namespace std;

int main()
{
	char str[222];
	cin >> str;

	int n = strlen(str);

	for (int i = n - 2; i; i -= 2) {
		if (strncmp(str, str + i / 2, i / 2) == 0) {
			cout << i << endl;
			return 0;
		}
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: 'strlen' was not declared in this scope
    9 |         int n = strlen(str);
      |                 ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
a.cc:12:21: error: 'strncmp' was not declared in this scope
   12 |                 if (strncmp(str, str + i / 2, i / 2) == 0) {
      |                     ^~~~~~~
a.cc:12:21: note: 'strncmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include <iostream>
using namespace std;

int main()
{
	char str[222];
	cin >> str;

	int n = strlen(str);

	for (int i = n - 2; i; i -= 2) {
		if (strncmp(str, str + i / 2, i / 2) == 0) {
			cout << i << endl;
			break;
		}
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: 'strlen' was not declared in this scope
    9 |         int n = strlen(str);
      |                 ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
a.cc:12:21: error: 'strncmp' was not declared in this scope
   12 |                 if (strncmp(str, str + i / 2, i / 2) == 0) {
      |                     ^~~~~~~
a.cc:12:21: note: 'strncmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

a, b, c = [int(i) for i in input().split()]
 
if a > b:
  a, b = b, a
 
if b > c:
  b, c = c, b
 
if a > b:
  a, b = b, a
 
print(a+b)

Compiler output:
a.cc:1:1: error: 'a' does not name a type
    1 | a, b, c = [int(i) for i in input().split()]
      | ^
Language: C++

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

int main() {
	int a,b,c;
	int i,j,k,n;
	string s;
	cin>>s;
	int panjang=s.length()-1;
	int jumlah=1;
	for (i=0;i<=199;i++)
	{
		string potong;
		potong=s;
		potong.erase(panjang-i,jumlah;)
		if (potong.length()%2==0)
		{
			int panjangpotong=potong.length();
			int dua=panjangpotong/2;
			bool cek=true;
			for (j=0;j<dua;j++)
			{
				if (potong[j]!=potong[j+dua])
				{
					cek=false;
					break;
				}
			}
			if (cek)
			{
				cout<<panjangpotong<<"\n";
				return 0;
			}
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:46: error: expected ')' before ';' token
   17 |                 potong.erase(panjang-i,jumlah;)
      |                             ~                ^
      |                                              )
a.cc:17:47: error: expected primary-expression before ')' token
   17 |                 potong.erase(panjang-i,jumlah;)
      |                                               ^
Language: C++

#include <string>
using namespace std;
int main(void){
	string S;
	int ans = 0;
	cin >> S;

	while(!S.empty()){
		S.pop_back();
		S.pop_back();

		int half_size = S.size()/2;
		// cout <<"half_size:"<<  half_size << endl;
		for(int i=0;i<half_size;++i){
			// cout << S[i] << ' ' << S[half_size + i] << endl;
			if(S[i] != S[half_size + i]) break;
			else if(i == half_size-1) ans = S.size();
		}
		if(ans > 0) break;
	}
	cout << ans << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope
    6 |         cin >> S;
      |         ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <string>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:21:9: error: 'cout' was not declared in this scope
   21 |         cout << ans << endl;
      |         ^~~~
a.cc:21:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:21:24: error: 'endl' was not declared in this scope
   21 |         cout << ans << endl;
      |                        ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include <string>
  +++ |+#include <ostream>
    2 | using namespace std;
Language: C++

#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
typedef  long long ll;
typedef  vector<int> vi;
typedef  pair<int,int> pii;
typedef  pair<int,string> pis;
double pi=3.1415926535898;
#define speed      ios::sync_with_stdio(false);cin.tie(NULL); cout.tie(NULL);
#define lop(i,n)   for(int i=0;i<int(n);i++)
#define rep(i,a,b) for(int i=a;i<=int(b);++i)
#define sz(x)      (int)x.size()
#define bb(x)      cerr<< x <<endl;
#define F          first
#define S          second       //  __builtin_popcount;
//freopen("output.txt","w",stdout),freopen("input.txt","r",stdin);
const ll M  = 1e9+7 ;
const int N = 100100;
const int inf = INT_MAX;
const double eps = 1e-7;
//////////////////////    Hi    ^_^  hack me if you can :P
 
 
int n;
int A;
int a[100100];
bool baned[1234567];
int alic;
int mx = 0;
int col ;
map < int, int > mm;
int main()
{
    speed;
    string s;
    cin >> s;
    int ans = 0;
    if (sz(s)&1) {s.pop_back();ans++;}
    while (sz(s)) {
    if (sz(s)&1) {s.pop_back();ans++;}
    else { bool ok = 1;
    lop(i,sz(s)/2) {if(s[i]!=s[i+sz(s)/2])  {s.pop_back();ans++;ok=0;break;}  } 
    if ( ok ) breake;
    }
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:15: error: 'breake' was not declared in this scope
   43 |     if ( ok ) breake;
      |               ^~~~~~
Language: C++

#include<iostream>
#include<string>
using namespace std;
 
int main(){
 string s;
 cin>>s;
 s=s.substr(0,s.size()-1);
 int len;
 for(len=s.size()/2;len>=0;len--){
 	if(s.substr(0,len) == s.substr(len,len)){
 		break;
	 }
 }
 cout<< len * 2<,endl;
 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: expected primary-expression before ',' token
   15 |  cout<< len * 2<,endl;
      |                 ^
Language: C++

#include<iostream>
#include<string>
using namespace std;
 
int main(){
 string s;
 cin>>s;
 s=s.substr(0,s.size()-1);
 int len
 for(len=s.size()/2;len>=0;len--){
 	if(s.substr(0,len) == s.substr(len,len)){
 		break;
	 }
 }
 cout<< len * 2<,endl;
 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:2: error: expected initializer before 'for'
   10 |  for(len=s.size()/2;len>=0;len--){
      |  ^~~
a.cc:10:21: error: 'len' was not declared in this scope; did you mean 'mblen'?
   10 |  for(len=s.size()/2;len>=0;len--){
      |                     ^~~
      |                     mblen
a.cc:15:17: error: expected primary-expression before ',' token
   15 |  cout<< len * 2<,endl;
      |                 ^
Language: C

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

int main(){
	
	int len,n,sp=1,s=0;
	char in[201];
	scanf("%s",in);

	while(1){
		len = strlen(in);
		len--;	
		in[len] = '\0';

		if(len%2 == 1){
			len--;
			in[len] = '\0';
		}
		for(i=0;i<len/2;i++){
			if(in[i] != in[i+len/2]){
				break;
			}
			if(i == len/2 - 1){
				printf("%d",i+1);
				return 0;
			}
		}
	}

	return -1;
}

Compiler output:
main.c: In function 'main':
main.c:19:21: error: 'i' undeclared (first use in this function); did you mean 'in'?
   19 |                 for(i=0;i<len/2;i++){
      |                     ^
      |                     in
main.c:19:21: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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

int main(){
	
	int len,n,sp=1,s=0;
	char in[201];
	scanf("%s",in)

	while(1){
		len = strlen(in);
		len--;	
		in[len] = '\0';

		if(len%2 == 1){
			len--;
			in[len] = '\0';
		}
		for(i=0;i<len/2;i++){
			if(in[i] != in[i+len/2]){
				break;
			}
			if(i == len/2 - 1){
				printf("%d",i+1);
				return 0;
			}
		}
	}

	return -1;
}

Compiler output:
main.c: In function 'main':
main.c:8:23: error: expected ';' before 'while'
    8 |         scanf("%s",in)
      |                       ^
      |                       ;
    9 | 
   10 |         while(1){
      |         ~~~~~
Language: C

#include<stdio.h>
#include<strlib.h>

int main(){
	
	int len,n,sp=1,s=0;
	char in[201];
	scanf("%s",in)

	while(1){
		len = strlen(in);
		len--;	
		in[len] = '\0';

		if(len%2 == 1){
			len--;
			in[len] = '\0';
		}
		for(i=0;i<len/2;i++){
			if(in[i] != in[i+len/2]){
				break;
			}
			if(i == len/2 - 1){
				printf("%d",i+1);
				return 0;
			}
		}
	}

	return -1;
}

Compiler output:
main.c:2:9: fatal error: strlib.h: No such file or directory
    2 | #include<strlib.h>
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

#include <cstdlib>
#include <iostream>
#include <queue>
#include <vector>
#include <cmath>
#include <string>
using namespace std;
typedef unsigned long long u64;
typedef signed long long l64;
u64 over = 1000000007;

int main(void)
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s;
  cin >> s;
  int n = s.size();
  for (int i = (n-1)/2; i >= 0; --i) {
    is (s.substr(0, i) == s.substr(i, i)) {
      cout << i*2 << endl;
      return 0;
    }
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:5: error: 'is' was not declared in this scope; did you mean 'i'?
   20 |     is (s.substr(0, i) == s.substr(i, i)) {
      |     ^~
      |     i
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <array>
#include <vector>
#include <functional>
#include <unordered_map> 
#include <map> 
#include <numeric>
#include <limits>
#include <utility>
#include <queue>
using namespace std;
typedef long long LL;
 
int main(void) {
	string s;
	cin >> s;
	for (int i = 0; i < s.size(); i++) {
		s.pop_back();
		if (s.size() % 2 == 0) {
			for (int j = 0; j < s.size() / 2; j++) {
				if (s[j] != s[j + (s.size() / 2)])break;
				if (j == s.size()/2 - 1) {
					cout << s.size() << endl;
					return 0;
				}
			}
		//}
	}
	cout << 0 << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:2: error: expected '}' at end of input
   34 | }
      |  ^
a.cc:17:16: note: to match this '{'
   17 | int main(void) {
      |                ^
Language: C++

#include<iostream>
#include<algorithm>
#include<string>

using namespace std;

int main(){
string s,a,b;
cin>>s;
int i =1;
if(s.size()%2==0){}
i++;
else
i+=2;
for(;i<s.size();i+=2){
for(int j=0;j<(s.size()-i)/2;j++)
a[j]=s[j];
for(int j=(s.size()-i)/2;j<s.size()-i;j++)
b[j-(s.size()-i)/2]=s[j];
if(a==b){
cout<<s.size()-i<<endl;
break;
}
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:1: error: 'else' without a previous 'if'
   13 | else
      | ^~~~
Language: C++

#include <iostream>
#include<string>
using namespace std;
int main(void){
    string s,a="",b="",str="";
    cin>>s;
    for(int i=0;;i++){
        for(int j=0;j<s.size();j++){
           s[s.size()-1-j]='';
            for(int l=0;l<s.size()/2;l++){
                a=a+str[l];
            }
            for(int l=s.size()/2;l<s.size();l++){
                b=b+str[l];
            }
            if(a==b)break;
            str="";
        }
        if(a==b){
            cout<<a.size()+b.size()<<endl;
            break;
        }
    }
   
    
    return 0;
}



Compiler output:
a.cc:9:28: error: empty character constant
    9 |            s[s.size()-1-j]='';
      |                            ^~
Language: Java

import java.util.Scanner;
 
public class Main {
 
    public static void main(String args[]){
 
    	//B問題
    	Scanner scan = new Scanner(System.in);
 
    	//文字列格納用
    	String S;
    	S = scan.next();
 
 
 
    	while(S.length() >= 2){
        	//1文字削除
        	if(S != null && S.length() > 0){
        	    S = S.substring(0, S.length()-1);
        	}
        	//文字数が偶数ならば
        	if(S.length() % 2 == 0){
        		String sa = S.substring(0,S.length() / 2);
        		String sb = S.substring(S.length() / 2 ,S.length());
        		if(sa.equals(sb)){
        			System.out.println(S.length());
        			break;
        		}
        	}
    	}

Compiler output:
Main.java:30: error: reached end of file while parsing
    	}
    	 ^
1 error
Language: Java

import java.util.Scanner;
 
public class Main {
 
    public static void main(String args[]){
 
    	//B問題
    	Scanner scan = new Scanner(System.in);
 
    	//文字列格納用
    	String S;
    	S = scan.next();
 
 
 
    	while(S.length() >= 2){
        	//1文字削除
        	if(S != null && S.length() > 0){
        	    S = S.substring(0, S.length()-1);
        	}
        	//文字数が偶数ならば
        	if(S.length() % 2 == 0){
        		String sa = S.substring(0,S.length() / 2);
        		String sb = S.substring(S.length() / 2 ,S.length());
        		if(sa.equals(sb)){
        			System.out.println(S.length());
        			break;
        		}
        	}
    	}
 
 }

Compiler output:
Main.java:32: error: reached end of file while parsing
 }
  ^
1 error
Language: Java

package atcoder0701;

import java.util.Scanner;

public class main {

    public static void main(String args[]){

    	//B問題
    	Scanner scan = new Scanner(System.in);

    	//文字列格納用
    	String S;
    	S = scan.next();



    	while(S.length() >= 2){
        	//1文字削除
        	if(S != null && S.length() > 0){
        	    S = S.substring(0, S.length()-1);
        	}
        	//文字数が偶数ならば
        	if(S.length() % 2 == 0){
        		String sa = S.substring(0,S.length() / 2);
        		String sb = S.substring(S.length() / 2 ,S.length());
        		if(sa.equals(sb)){
        			System.out.println(S.length());
        			break;
        		}
        	}
    	}


    }

}


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

import java.util.Scanner;

public class Main {

    public static void main(String args[]){

    	//B問題
    	Scanner scan = new Scanner(System.in);

    	//文字列格納用
    	String S;
    	S = scan.next();



    	while(S.length() >= 2){
        	//1文字削除
        	if(S != null && S.length() > 0){
        	    S = S.substring(0, S.length()-1);
        	}
        	//文字数が偶数ならば
        	if(S.length() % 2 == 0){
        		String sa = S.substring(0,S.length() / 2);
        		String sb = S.substring(S.length() / 2 ,S.length());
        		if(sa.equals(sb)){
        			System.out.println(S.length());
        			break;
        		//}
        	}
    	}
}

Compiler output:
Main.java:31: error: reached end of file while parsing
}
 ^
1 error
Language: C++

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

bool iseven(string& str)
{
	if (str.length() % 2 != 0)return false;
	else
	{
		if (string(str.begin(), str.begin() + str.length() / 2) == string(str.begin() + str.length() / 2, str.end()))
			return true;
		else return false;
	}
}

int main(void)
{
	string str;
	cin >> str;
	int len = str.length();
	for (int i = len-1; i >=2; i--)//长度
	{
		for (int j = 0; j + i != len; j++) {
			if (iseven(string(str.begin() + j, str.begin() + j + i))) {
				cout << i << endl;
				return 0;
			}
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:36: error: cannot bind non-const lvalue reference of type 'std::string&' {aka 'std::__cxx11::basic_string<char>&'} to an rvalue of type 'std::string' {aka 'std::__cxx11::basic_string<char>'}
   24 |                         if (iseven(string(str.begin() + j, str.begin() + j + i))) {
      |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:5:21: note:   initializing argument 1 of 'bool iseven(std::string&)'
    5 | bool iseven(string& str)
      |             ~~~~~~~~^~~
Language: C++

#include<iostream>
#include<algorithm>
#include<string>

using namespace std;

int main(){
string s,a,b;
cin>>s;
for(int i =0;i<s.size();i+=2){
if(s.size()%2==1)
i++;
for(int j=0;j<(s.size()-i)/2;j++)
a[j]=s[j];
for(int j=(s.size()-i)/2;j<s.size())-i;j++)
b[j]=s[j];
if(a==b){
cout<<s.size()<<endl;
break;
}
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:36: error: expected ';' before ')' token
   15 | for(int j=(s.size()-i)/2;j<s.size())-i;j++)
      |                                    ^
      |                                    ;
a.cc:15:40: error: 'j' was not declared in this scope
   15 | for(int j=(s.size()-i)/2;j<s.size())-i;j++)
      |                                        ^
Language: C++

We will call a string that can be obtained by concatenating two equal strings an even string. For example, xyzxyz and aaaaaa are even, while ababab and xyzxy are not.

You are given an even string S consisting of lowercase English letters. Find the length of the longest even string that can be obtained by deleting one or more characters from the end of S. It is guaranteed that such a non-empty string exists for a given input.

Constraints
2≤|S|≤200
S is an even string consisting of lowercase English letters.
There exists a non-empty even string that can be obtained by deleting one or more characters from the end of S.


Compiler output:
a.cc:6:1: error: extended character ≤ is not valid in an identifier
    6 | 2≤|S|≤200
      | ^
a.cc:6:6: error: extended character ≤ is not valid in an identifier
    6 | 2≤|S|≤200
      |      ^
a.cc:1:1: error: 'We' does not name a type
    1 | We will call a string that can be obtained by concatenating two equal strings an even string. For example, xyzxyz and aaaaaa are even, while ababab and xyzxy are not.
      | ^~
Language: Java

import java.util.Scanner;

public class SS{
	
	public static void Main(String[] args){
		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine();
		sc.close();
		
		for(int i = 1; i < str.length(); i++) {
			if(isEven(str.substring(0, str.length()-i))) {
				System.out.println(str.length() - i);
				break;
			}
		}
	}
	
	static boolean isEven(String str) {
		if(str.length() % 2 == 1) return false;
		else {
			for(int i = 0; i < str.length() / 2; i++) {
				if(str.charAt(i) != str.charAt(str.length() / 2 + i)) return false;
			}
			return true;
		}
	}
}


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

#include<stdio.h>
#include<string.h>
int main ()
{
	char s[250];
	while(gets(s))
	{
		int i,len,n;
		len=strlen(s);
		n=len/2-1;
		while(n)
		{
			int k=0;
			for(i=0;i<n;i++)
				if(s[i]!=s[i+n])
					k++;
				n--;
			if(k==0){
				printf("%d\n",n*2-2);	
				break;
			}		
		}
	}
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:6:15: error: 'gets' was not declared in this scope; did you mean 'getw'?
    6 |         while(gets(s))
      |               ^~~~
      |               getw
Language: C++

#include<stdio.h>
#include<string.h>
char s[250];
int main ()
{
	while(scanf("%s",s)!=EOF)
	{
		int i,len,n,;
		len=strlen(s);
		n=len/2-1;
		while(n)
		{
			int k=0;
			for(i=0;i<n;i++)
				if(s[i]!=s[i+n])
					k++;
				n--;
			if(k==0){
				printf("%d\n",n*2+2);	
				break;
			}		
		}
	}
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:8:29: error: expected unqualified-id before ';' token
    8 |                 int i,len,n,;
      |                             ^
Language: C++

#include<stdio.h>
#include<string.h>
int main ()
{
	char s[250];
	while(scanf("%s",s)!=EOF)
	{
		int i,len,n,;
		len=strlen(s);
		n=len/2-1;
		while(n)
		{
			int k=0;
			for(i=0;i<n;i++)
				if(s[i]!=s[i+n])
					k++;
				n--;
			if(k==0){
				printf("%d\n",n*2+2);	
				break;
			}		
		}
	}
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:8:29: error: expected unqualified-id before ';' token
    8 |                 int i,len,n,;
      |                             ^
Language: C++

#include<stdio.h>
#include<string.h>
int main ()
{
	char s[250];
	while(gets(s))
	{
		int i,len,n,;
		len=strlen(s);
		n=len/2-1;
		while(n)
		{
			int k=0;
			for(i=0;i<n;i++)
				if(s[i]!=s[i+n])
					k++;
				n--;
			if(k==0){
				printf("%d\n",n*2+2);	
				break;
			}		
		}
	}
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:6:15: error: 'gets' was not declared in this scope; did you mean 'getw'?
    6 |         while(gets(s))
      |               ^~~~
      |               getw
a.cc:8:29: error: expected unqualified-id before ';' token
    8 |                 int i,len,n,;
      |                             ^
Language: Java

import java.util.Scanner;

public class B {
  private static boolean is_even(String s) {
    if (0 == s.length() % 2) {
      return true;
    }
    else {
      return false;
    }
  }

  private static boolean is_even_string(String s) {
    int length = s.length();
    if (s.substring(0, length / 2).equals(s.substring(length / 2, length))) {
      return true;
    }
    else {
      return false;
    }
  }

  public static void main(String[] args) {
    Scanner stdIn = new Scanner(System.in);

    String s = stdIn.next();
    s = s.substring(0, s.length()-1);

    for (int i = s.length(); i > 1; i--) {
      if (!is_even(s)) {
        s = s.substring(0, s.length()-1);
        continue;
      }
      if (is_even_string(s)) {
        System.out.println(s.length());
      }
      s = s.substring(0, s.length()-1);

    }
  }
}


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

#define _CRT_SECURE_NO_WARNINGS
//#define DEBUG
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>

//後ろから２文字ずつ削って判定してく関数
//配列をポインタで渡す場合長さも渡しておく
int mojikezuri(char* str, int length) {
	int flag = 0;
	int l2=length/2;
	char str1[101];
	char str2[101];
	int i;
	int ans;

	strcpy(str1, str, l2);
	strcpy(str2, str + l2, l2);
	str1[l2] = '\0';
	str2[l2] = '\0';
#ifdef DEBUG
	printf("%s\n", str1);
	printf("%s\n", str2);
#endif

	if (strcmp(str1,str2)) {
		ans = mojikezuri(str, length - 2);
	}
	else {
		ans = length;
	}
	return ans;
}
int main(void) {
#ifdef DEBUG
	printf("");
#endif

	char S[201] = { '\0' };
	int length=0;
	int ans=0;
	int i;
	
	scanf("%s", S);

#ifdef DEBUG
	printf("%s\n", S);
#endif
	for (i = 0; i < 200; i++) {
		if (S[i] == '\0') {
			length = i;
			break;
		}
	}
#ifdef DEBUG
	printf("length=%d\n", length);
#endif

	ans = mojikezuri(S,length-2);

	printf("%d\n", ans);

	return 0;
}


Compiler output:
main.c: In function 'mojikezuri':
main.c:18:9: error: too many arguments to function 'strcpy'
   18 |         strcpy(str1, str, l2);
      |         ^~~~~~
In file included from main.c:4:
/usr/include/string.h:141:14: note: declared here
  141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
      |              ^~~~~~
main.c:19:9: error: too many arguments to function 'strcpy'
   19 |         strcpy(str2, str + l2, l2);
      |         ^~~~~~
/usr/include/string.h:141:14: note: declared here
  141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
      |              ^~~~~~
Language: C++

#include <iostream>
#include<string>
using namespace std;
int main(void){
    string s,a,b;
    cin>>s;
    for(int i=0;;i++){
        for(int j=0;j<s.size();j++){
            s=s-s[s.size()-j-1];
            for(int l=0;l<s.size()/2;l++){
                a=a+a[l];
            }
            for(int l=s.size()/2;l<s.size();l++){
                b=b+b[l];
            }
            if(a==b)break;
        }
        if(a==b){
            cout<<a.size()+b.size()<<endl;
            break;
        }
    }
   
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:16: error: no match for 'operator-' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'})
    9 |             s=s-s[s.size()-j-1];
In file included from /usr/include/c++/14/string:48,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_iterator.h:618:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
  618 |     operator-(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:618:5: note:   template argument deduction/substitution failed:
a.cc:9:31: note:   'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
    9 |             s=s-s[s.size()-j-1];
      |                               ^
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
 1790 |     operator-(const move_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note:   template argument deduction/substitution failed:
a.cc:9:31: note:   'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
    9 |             s=s-s[s.size()-j-1];
      |                               ^
Language: C

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

int Main(void){
	int i=0,j,k,count=0,s=0;
	char list[200][200];

	while(scanf("%s",list[i])!=EOF){
		i++;
		if(i==1) break;
	}

	for (k = strlen(list[0])-1; k>1; k--)
	{
		s=0;
		if(k%2==0)
		{
			for(j=0;j<k/2;j++){
				if(list[0][j]!=list[0][j+k/2]) s=1; 
			}
			if(s==0) break;
		}
	}

	printf("%d\n",k);


}

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 <cstdio>
#include <algorithm>
using namespace std;
 
 

int main (){
    char s[300] = {0};
    int ans = 0;
    int i,j;
    scanf("%s",s);
    ans = strlen(s);
    while(1){
        ans -= 2;
        j = ans / 2;
        int z = ans /2; 
        for(i=0;i<j;i++){
            if(s[i] != s[z]){
                //printf("%d %d %d\n",i,j,ans);
                break;
            }else{
                z++;
            }
            
        }
         if(z  ==  ans){
                printf("%d\n",ans);
                break;
        }
    }


    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:11: error: 'strlen' was not declared in this scope
   13 |     ans = strlen(s);
      |           ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <algorithm>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: C++

#include <iostream>
#include <numeric>
#include <algorithm>
#include <string>

int main(void)
{
  std::string S;
  std::cin >> S;

  std::vector<std::string> checker;

  size_t pos = 0;
  for(size_t i = 2, end = S.size(); i < end; i+=2, pos+=1){
    checker.push_back(S.substr(0, i));
  }

  for(auto it = checker.rbegin(), end=checker.rend(); it != end; ++it){
    if(it->substr(0, it->size()/2) == it->substr(it->size()/2)){
      std::cout << it->size() << std::endl;
      return 0;
    }
  }
  return -1;
}






Compiler output:
a.cc: In function 'int main()':
a.cc:11:8: error: 'vector' is not a member of 'std'
   11 |   std::vector<std::string> checker;
      |        ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    3 | #include <algorithm>
  +++ |+#include <vector>
    4 | #include <string>
a.cc:11:26: error: expected primary-expression before '>' token
   11 |   std::vector<std::string> checker;
      |                          ^
a.cc:11:28: error: 'checker' was not declared in this scope
   11 |   std::vector<std::string> checker;
      |                            ^~~~~~~
a.cc:18:61: error: 'end' was not declared in this scope; did you mean 'std::end'?
   18 |   for(auto it = checker.rbegin(), end=checker.rend(); it != end; ++it){
      |                                                             ^~~
      |                                                             std::end
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/range_access.h:116:37: note: 'std::end' declared here
  116 |   template<typename _Tp> const _Tp* end(const valarray<_Tp>&) noexcept;
      |                                     ^~~
Language: C++

s = input()
s = s[:len(s) - 1]
if len(s) % 2 != 0:
	s = s[:len(s) - 1]

while True:
	mid = int(len(s) / 2)
	if s[:mid] == s[mid:]:
		print(len(s))
		break
	else:
		s = s[:len(s) - 1]

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

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

int main()
{
	char s[201];

	scanf("%s",s);

	int len=strlen(s);
	int i,j;
	for(i=1;i<len/2;i++){
		int k=len-i*2;
		int count=0;
		for(j=0;j<k/2;j++){
			if(s[j]==s[j+k/2])count++;
		}
		if(count==k/2){
			printf("%d\n",count*2);
			break;
		}
	}
	return 0;


Compiler output:
main.c: In function 'main':
main.c:24:9: error: expected declaration or statement at end of input
   24 |         return 0;
      |         ^~~~~~
Language: C++

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

int main()
{
	char s[201];

	scanf("%s",s);

	int len=strlen(s);
	int i,j;
	for(i=1;i<len/2;i++){
		int k=len-i*2;
		int count=0;
		for(j=0;j<k/2;j++){
			if(s[j]==s[j+k/2])count++;
		}
		if(count==k/2){
			printf("%d\n",count*2);
			break;
		}
	}
	return 0;


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

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

int main(){

  string s;

  cin >> s;

  int n = s.size() - 2;
  for(int i=0; i<n/2; i++){
    if(s[i]!=s[i+n/2]){
      n -= 2;
    } else {
      cout << n << endl;
      break;
    }
  }

  
  return 0;
}

Compiler output:
a.cc:2:9: fatal error: vector#include<string: No such file or directory
    2 | #include<vector#include<string>
      |         ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main(int argc, char* argv[])
{
	char p[201];
	string S;
	cin>>S;
	int SLen=S.size();

	char *pStr=(char*)S.c_str();
	string s;
	int i=0;
	int maxNum=0;
	int maxLen=0;
	for (int len=1;len<=SLen;len++){
		memset(p,0,201);
		strncpy(p,pStr,len);
		int num=0;
		for (i=0;i<SLen;i+=len){
			if (memcmp(pStr+i,p,len)){
				break;
			}
			num++;
		}
		if (maxNum<num){
			maxNum=num;
			maxLen=len;
		}
	}
	if (maxNum==1){
		cout<<0<<endl;
		return 0;
	}
	if (maxNum==SLen){
		if (maxNum%2==1){
			maxNum--;
		}
		cout<<maxNum/2<<endl;
		return 0;
	}
	if (maxNum%2==1){
		maxNum--;
	}
	cout<<maxNum*maxLen<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:17:17: error: 'memset' was not declared in this scope
   17 |                 memset(p,0,201);
      |                 ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <string>
a.cc:18:17: error: 'strncpy' was not declared in this scope
   18 |                 strncpy(p,pStr,len);
      |                 ^~~~~~~
a.cc:18:17: note: 'strncpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:21:29: error: 'memcmp' was not declared in this scope
   21 |                         if (memcmp(pStr+i,p,len)){
      |                             ^~~~~~
a.cc:21:29: note: 'memcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;
typedef long long ll;

int main() {
    string s;
    cin >> s;
    int sz = s.size();
    int ans = 0;
    for(int i=sz-2;i>=0;i-=2) {
        int c = i/2;
        bool ok = true;;
        for(int j=0;j<c;j++) {
            if(s[j] != s[j+c]) {
                ok = false;
                break;
            }
        }
        if(ok) {
            ans = i;
            break;
        }
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'string' was not declared in this scope
    9 |     string s;
      |     ^~~~~~
a.cc:4:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
    3 | #include <cmath>
  +++ |+#include <string>
    4 | 
a.cc:10:5: error: 'cin' was not declared in this scope
   10 |     cin >> s;
      |     ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #include <cmath>
  +++ |+#include <iostream>
    4 | 
a.cc:10:12: error: 's' was not declared in this scope
   10 |     cin >> s;
      |            ^
a.cc:27:5: error: 'cout' was not declared in this scope
   27 |     cout << ans << endl;
      |     ^~~~
a.cc:27:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:27:20: error: 'endl' was not declared in this scope
   27 |     cout << ans << endl;
      |                    ^~~~
a.cc:4:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    3 | #include <cmath>
  +++ |+#include <ostream>
    4 |
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main()
{
    char s[200];
    gets(s);
    int len = strlen(s);
    for(int i=(len-2)/2;i>0;--i)
    {
        int x = 0;
        for(int j=0;j<i;++j)
        {
            if(s[j] == s[j+i])  x++;
        }
        if(x==i)
        {
            cout<<2*i<<endl;
            return 0;
        }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
    8 |     gets(s);
      |     ^~~~
      |     getw
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main()
{
    char s[200];
    gets(s);
    int len = strlen(s);
    for(int i=(len-2)/2;i>0;--i)
    {
        int x = 0;
        for(int j=0;j<i;++j)
        {
            if(s[j] == s[j+i])  x++;
        }
        if(x==i)
        {
            cout<<2*i<<endl;
            return 0;
        }
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
    8 |     gets(s);
      |     ^~~~
      |     getw
Language: C++

h#include <bits/stdc++.h>

using namespace std;

int main(void){
  string s;
  cin >> s;

  char c[201] = {'\0'};
  bool sw = false;
  s.copy(c, s.size());
  for(int i = s.size() - 2; i > 0; i--){
    if(i %2 == 0) continue;
    for (int j = 0; j <= i / 2; j++){
      if(c[j] != c[i / 2 + 1 + j]) break;
      if (j == i / 2) sw = true;
    }
    if(sw){
      /*
      for(int j = 0; j <= i; j++){
        cout << c[j] << flush;
      }
      cout << endl;
      */
      cout << i + 1 << endl;
      return 0;
    }
  }

  //cout << c[0] << endl;
  cout << 1 << endl;

  return 0;
}


Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | h#include <bits/stdc++.h>
      |  ^
a.cc:1:1: error: 'h' does not name a type
    1 | h#include <bits/stdc++.h>
      | ^
a.cc: In function 'int main()':
a.cc:6:3: error: 'string' was not declared in this scope
    6 |   string s;
      |   ^~~~~~
a.cc:7:3: error: 'cin' was not declared in this scope
    7 |   cin >> s;
      |   ^~~
a.cc:7:10: error: 's' was not declared in this scope
    7 |   cin >> s;
      |          ^
a.cc:25:7: error: 'cout' was not declared in this scope
   25 |       cout << i + 1 << endl;
      |       ^~~~
a.cc:25:24: error: 'endl' was not declared in this scope
   25 |       cout << i + 1 << endl;
      |                        ^~~~
a.cc:31:3: error: 'cout' was not declared in this scope
   31 |   cout << 1 << endl;
      |   ^~~~
a.cc:31:16: error: 'endl' was not declared in this scope
   31 |   cout << 1 << endl;
      |                ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    string s;
    cin>>s;
    cout<<s.len()<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:13: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'len'
    6 |     cout<<s.len()<<endl;
      |             ^~~
Language: Java

import java.util.*;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        
        int N = sc.nextInt();
        int[] a = new int[N];
        
        for(int i=0; i<N; i++){
            a[i] = sc.nextInt();
        }
        
        for(int i=N-1;i>=0;i-=2){
        	System.out.print(a[i] + " ");
        }
        for(int j=n%2;j<N;j+=2){
        	System.out.print(a[j] + " ");
        }
   }
}


Compiler output:
Main.java:17: error: cannot find symbol
        for(int j=n%2;j<N;j+=2){
                  ^
  symbol:   variable n
  location: class Main
1 error
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int main(){
    int n,m;
    cin>>n;
    vector<int>a();
    for(int i=0;i<n;i++){
        cin>>m;
        a.push_back(m);
        reverse(a.begin(),a.end());
    }
    for(int i=0;i<a.size();i++)cout<<a[i]<<" ";
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
    7 |     vector<int>a();
      |                 ^~
a.cc:10:11: error: request for member 'push_back' in 'a', which is of non-class type 'std::vector<int>()'
   10 |         a.push_back(m);
      |           ^~~~~~~~~
a.cc:11:19: error: request for member 'begin' in 'a', which is of non-class type 'std::vector<int>()'
   11 |         reverse(a.begin(),a.end());
      |                   ^~~~~
a.cc:11:29: error: request for member 'end' in 'a', which is of non-class type 'std::vector<int>()'
   11 |         reverse(a.begin(),a.end());
      |                             ^~~
a.cc:11:9: error: 'reverse' was not declared in this scope
   11 |         reverse(a.begin(),a.end());
      |         ^~~~~~~
a.cc:13:21: error: request for member 'size' in 'a', which is of non-class type 'std::vector<int>()'
   13 |     for(int i=0;i<a.size();i++)cout<<a[i]<<" ";
      |                     ^~~~
a.cc:13:41: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   13 |     for(int i=0;i<a.size();i++)cout<<a[i]<<" ";
      |                                         ^
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int main(){
    int n,m;
    cin>>n;
    vector<int>a(0);
    for(int i=0;i<n;i++){
        cin>>m;
        a.push_back(m);
        reverse(a.begin(),a.end());
    }
    for(int i=0;i<a.size();i++)cout<<a[i]<<" ";
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'reverse' was not declared in this scope
   11 |         reverse(a.begin(),a.end());
      |         ^~~~~~~