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

#include <bits/stdc++.h>
using namespace std;
int N;
string s, t;
int solve() {
  for (int i = 0; i < N; i++) {
    if (s.substr(i) == t.substr(0, N-i)) return N+i;
  return N*2;

int main() {
  cin >> N >> s >> t;
  cout << solve() << endl;


Compiler output:
a.cc: In function 'int solve()':
a.cc:10:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   10 | int main() {
      |         ^~
a.cc:10:9: note: remove parentheses to default-initialize a variable
   10 | int main() {
      |         ^~
      |         --
a.cc:10:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:10:12: error: a function-definition is not allowed here before '{' token
   10 | int main() {
      |            ^
a.cc:12:27: error: expected '}' at end of input
   12 |   cout << solve() << endl;
      |                           ^
a.cc:6:31: note: to match this '{'
    6 |   for (int i = 0; i < N; i++) {
      |                               ^
a.cc:12:27: error: expected '}' at end of input
   12 |   cout << solve() << endl;
      |                           ^
a.cc:5:13: note: to match this '{'
    5 | int solve() {
      |             ^
a.cc:12:27: warning: control reaches end of non-void function [-Wreturn-type]
   12 |   cout << solve() << endl;
      |                           ^
Language: C++

n=int(input())
s=input()
t=input()

fin=1
for i in range(n):
    flag=1
    j=0
    while i+j<n:
        if t[j]!=s[i+j]:
            flag=0
        j=j+1
    if flag:
        print(n-i+i*2)
        fin=0
if fin:
    print(2*n)

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

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

int main(void) {
  int n;
  string s, t;
  cin >> n >> s >> t;
  
  int ans = 0;
  for (int i = 0; i < n; i++) {
    int cnt = 0;
    for (int j = 0; j <= i; j++) {
      if (t[j] == s[n - 1 - i + j]) cnt++;
    }
    if (cnt == i + 1) ans = cnt;
  }
  cout << cnt << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:11: error: 'cnt' was not declared in this scope; did you mean 'int'?
   17 |   cout << cnt << endl;
      |           ^~~
      |           int
Language: C++

#include<iostream>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<map>
using namespace std;
int main() {
  int n,cnt=0;
  string s,t;
  cin >> n >> s >> t;
  for(int i=1; i<=n; i++) {
    if(s.substr(n-i)==t.substr(0,i) {
      cnt=max(cnt,i);
    }
  }
  cout << n*2-cnt << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:36: error: expected ')' before '{' token
   12 |     if(s.substr(n-i)==t.substr(0,i) {
      |       ~                            ^~
      |                                    )
a.cc:15:3: error: expected primary-expression before '}' token
   15 |   }
      |   ^
Language: C++

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

int N;
string s,t;

int solve(){
  for (int i=0;i<N;++i){
    if(s.substr(i)==t.substr(0,N-i))return i+N;
  }
  return N*2;
}

int main(){
  cin >>N>>s>>t;
  count<<solve()<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:3: error: 'count' was not declared in this scope
   17 |   count<<solve()<<endl;
      |   ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main{
int N;
string s,t;
cin>>N>>s>>t;
int count=0;
for(int i=0;i<N;i++){
  if(s.at(i)==t.at(0)){
    for(int j=0;i+j<N;j++){
      if(s.at(i+j)==t.at(j)){
        count++;
      }
      else{
        count=0;
        break;
      }
    }
  }
}
cout<<2*N-count;
}


Compiler output:
a.cc:3:5: error: cannot declare '::main' to be a global variable
    3 | int main{
      |     ^~~~
a.cc:4:1: error: expected primary-expression before 'int'
    4 | int N;
      | ^~~
a.cc:4:1: error: expected '}' before 'int'
a.cc:3:9: note: to match this '{'
    3 | int main{
      |         ^
a.cc:6:1: error: 'cin' does not name a type
    6 | cin>>N>>s>>t;
      | ^~~
a.cc:8:1: error: expected unqualified-id before 'for'
    8 | for(int i=0;i<N;i++){
      | ^~~
a.cc:8:13: error: 'i' does not name a type
    8 | for(int i=0;i<N;i++){
      |             ^
a.cc:8:17: error: 'i' does not name a type
    8 | for(int i=0;i<N;i++){
      |                 ^
a.cc:21:1: error: 'cout' does not name a type
   21 | cout<<2*N-count;
      | ^~~~
a.cc:22:1: error: expected declaration before '}' token
   22 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int N;
string s,t;
cin>>N>>s>>t;
int count=0;
for(int i=0;i<N;i++){
  if(s.at(i)==t.at(0)){
    for(int j=0;i+j<N;j++){
      if(s.at(i+j)==t.at(j)){
        count++;
      }
      else{
        count=0;
        break;
      }
    }
  }
}
cout<<2*N-count;
}

Compiler output:
a.cc:5:1: error: 'cin' does not name a type
    5 | cin>>N>>s>>t;
      | ^~~
a.cc:7:1: error: expected unqualified-id before 'for'
    7 | for(int i=0;i<N;i++){
      | ^~~
a.cc:7:13: error: 'i' does not name a type
    7 | for(int i=0;i<N;i++){
      |             ^
a.cc:7:17: error: 'i' does not name a type
    7 | for(int i=0;i<N;i++){
      |                 ^
a.cc:20:1: error: 'cout' does not name a type
   20 | cout<<2*N-count;
      | ^~~~
a.cc:21:1: error: expected declaration before '}' token
   21 | }
      | ^
Language: C++

//In The Name Of GOD
#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const int inf = 2000000000;
const int maxn = 100000;
#define ll long long
#define pb push_back
#define mp make_pair
#define IO ios_base::sync_with_stdio(false);
int A[3*maxn];
bool mark[3*maxn];
int main(){
  IO;
  int n,m;
  cin>>n>>m;
  if(m==1||m==2*n-1){
    cout<<"No";
    return 0;
  }else{
    cout<<"YES\n";
      if(m<n){
        A[n-1]=2*n-1;mark[2*n-1]=true;
        A[n]=m;mark[m]=true;
        A[n+1]=1;mark[1]=true;
        A[n+2]=2*n-2;mark[2*n-2]=true;
        int a=0,b=1;
      }else if(m>n){
        b/=a;
        A[n-1]=1;mark[1]=true;
        A[n]=m;mark[m]=true;
        A[n+1]=2*n-1;mark[2*n-1]=true;
        A[n+2]=2;mark[2]=true;
      }
  }
  int i=1,j=1;
  while(i<=2*n-1&&j<=2*n-1){
    if(!A[i]){
      if(!mark[j]){
        A[i]=j;
        j++;
      }else{
        j++;
      }
    }else{
      i++;
    }
  }
  for(int i=0;i<2*n-1;i++){
    cout<<A[i+1]<<endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:9: error: 'b' was not declared in this scope
   29 |         b/=a;
      |         ^
a.cc:29:12: error: 'a' was not declared in this scope
   29 |         b/=a;
      |            ^
Language: C++

N=int(input())
s=input()
t=input()
c=N
for i in range(N):
    if s[i:N]==t[0:(N-i)]:c=i
print(N*2-(N-c))

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

#include <bits/stdc++.h>
using namespace std;
 
#define dump(x)  cout << #x << " = " << (x) << endl;
 
typedef long long ll;
typedef pair<int, int> ii;
const int mod = 1e9+7;
const ll INF = 1e18;
const int inf = 1e9;
 
void solve()
{
  int n;cin>>n;
  string s,t;
  cin>>s>>t;
 
  int p=0;
  for (int i=0; i<=n; i++) {
    if (s.substr(n-i,i) == t.substr(0,i)) {
      p = i;
    }
  }
  cout << 2*n-p << endl;
}
 
int main()
{
  solve();
  return 0;
}
#include <bits/stdc++.h>
using namespace std;

#define dump(x)  cout << #x << " = " << (x) << endl;

typedef long long ll;
typedef pair<int, int> ii;
const int mod = 1e9+7;
const ll INF = 1e18;
const int inf = 1e9;

void solve()
{
  int n;cin>>n;
  string s,t;
  cin>>s>>t;

  int p=0;
  for (int i=0; i<=n; i++) {
    if (s.substr(n-i,i) == t.substr(0,i)) {
      p = i;
    }
  }
  cout << 2*n-p << endl;
}

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


Compiler output:
a.cc:39:11: error: redefinition of 'const int mod'
   39 | const int mod = 1e9+7;
      |           ^~~
a.cc:8:11: note: 'const int mod' previously defined here
    8 | const int mod = 1e9+7;
      |           ^~~
a.cc:40:10: error: redefinition of 'const ll INF'
   40 | const ll INF = 1e18;
      |          ^~~
a.cc:9:10: note: 'const ll INF' previously defined here
    9 | const ll INF = 1e18;
      |          ^~~
a.cc:41:11: error: redefinition of 'const int inf'
   41 | const int inf = 1e9;
      |           ^~~
a.cc:10:11: note: 'const int inf' previously defined here
   10 | const int inf = 1e9;
      |           ^~~
a.cc:43:6: error: redefinition of 'void solve()'
   43 | void solve()
      |      ^~~~~
a.cc:12:6: note: 'void solve()' previously defined here
   12 | void solve()
      |      ^~~~~
a.cc:58:5: error: redefinition of 'int main()'
   58 | int main()
      |     ^~~~
a.cc:27:5: note: 'int main()' previously defined here
   27 | int main()
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
#define dump(x)  cout << #x << " = " << (x) << endl;
 
typedef long long ll;
typedef pair<int, int> ii;
const int mod = 1e9+7;
const ll INF = 1e18;
const int inf = 1e9;
 
void solve()
{
  int n;cin>>n;
  string s,t;
  cin>>s>>t;
 
  int p=0;
  for (int i=0; i<=n; i++) {
    if (s.substr(n-i,i) == t.substr(0,i)) {
      p = i;
    }
  }
  cout << 2*n-p << endl;
}
 
int main()
{
  solve();
  return 0;
}
#include <bits/stdc++.h>
using namespace std;

#define dump(x)  cout << #x << " = " << (x) << endl;

typedef long long ll;
typedef pair<int, int> ii;
const int mod = 1e9+7;
const ll INF = 1e18;
const int inf = 1e9;

void solve()
{
  int n;cin>>n;
  string s,t;
  cin>>s>>t;

  int p=0;
  for (int i=0; i<=n; i++) {
    if (s.substr(n-i,i) == t.substr(0,i)) {
      p = i;
    }
  }
  cout << 2*n-p << endl;
}

int main()
{
  solve();
  
}


Compiler output:
a.cc:39:11: error: redefinition of 'const int mod'
   39 | const int mod = 1e9+7;
      |           ^~~
a.cc:8:11: note: 'const int mod' previously defined here
    8 | const int mod = 1e9+7;
      |           ^~~
a.cc:40:10: error: redefinition of 'const ll INF'
   40 | const ll INF = 1e18;
      |          ^~~
a.cc:9:10: note: 'const ll INF' previously defined here
    9 | const ll INF = 1e18;
      |          ^~~
a.cc:41:11: error: redefinition of 'const int inf'
   41 | const int inf = 1e9;
      |           ^~~
a.cc:10:11: note: 'const int inf' previously defined here
   10 | const int inf = 1e9;
      |           ^~~
a.cc:43:6: error: redefinition of 'void solve()'
   43 | void solve()
      |      ^~~~~
a.cc:12:6: note: 'void solve()' previously defined here
   12 | void solve()
      |      ^~~~~
a.cc:58:5: error: redefinition of 'int main()'
   58 | int main()
      |     ^~~~
a.cc:27:5: note: 'int main()' previously defined here
   27 | int main()
      |     ^~~~
Language: C++

#include <iostream>
using namesapce std;

int main(){
  int n;
  string a,b;
  cin >> n >> a >> b;
  int count=0;
  for(int i=1;i<=n;i++){
    bool check=true;
    for(int j=0;j<i;j++){
      if(a.at(n-i+j)!=b.at(j));
      check=false;
    }
    if(check) count=i;
  }
  cout << 2*n-count << endl;
}
  

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namesapce'
    2 | using namesapce std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'string' was not declared in this scope
    6 |   string a,b;
      |   ^~~~~~
a.cc:6:3: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included 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:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |   cin >> n >> a >> b;
      |   ^~~
      |   std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:15: error: 'a' was not declared in this scope
    7 |   cin >> n >> a >> b;
      |               ^
a.cc:7:20: error: 'b' was not declared in this scope
    7 |   cin >> n >> a >> b;
      |                    ^
a.cc:17:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   17 |   cout << 2*n-count << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:17:24: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   17 |   cout << 2*n-count << endl;
      |                        ^~~~
      |                        std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

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

int main(){
  int N;
  string S,T;
  cin >> N >> S >> T;
  int f;
  for(int i=0;i<N;i++){
    f=0;
    for (int j=i;j<N;j++){
      f+=T[j]==S[N-1-j]?0:1;
    }
    if (f==0){
      S.erace(S.begin()+i,S.end());
      cout << S << T << endl;
      return 0;
    }
  }
  cout  << S << T << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'erace'; did you mean 'erase'?
   15 |       S.erace(S.begin()+i,S.end());
      |         ^~~~~
      |         erase
Language: C++

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

int N;
string s, t;

string solve() {
    for (int i = 0; i < N; ++i) {
        if (s.substr(i) == t.substr(0, N-i)) return i + N;
    }
    return N*2;
}
int main() {
    cin >> N >> s >> t;
    cout << solve() << endl;
}


Compiler output:
a.cc: In function 'std::string solve()':
a.cc:10:55: error: could not convert '(i + N)' from 'int' to 'std::string' {aka 'std::__cxx11::basic_string<char>'}
   10 |         if (s.substr(i) == t.substr(0, N-i)) return i + N;
      |                                                     ~~^~~
      |                                                       |
      |                                                       int
a.cc:12:13: error: could not convert '(N * 2)' from 'int' to 'std::string' {aka 'std::__cxx11::basic_string<char>'}
   12 |     return N*2;
      |            ~^~
      |             |
      |             int
Language: Java


import java.util.Scanner

object Main extends App {
  val sc = new Scanner(System.in)

  val n = sc.nextInt
  val s, t = sc.next
  val ans = (0 until n)
    .map(i => (i, s.substring(i), t.substring(0, n - i)))
    .find(t => t._2 == t._3)
    .map(n + _._1)
    .getOrElse(2 * n)
  println(ans)
}


Compiler output:
Main.java:2: error: ';' expected
import java.util.Scanner
                        ^
1 error
Language: C++

#include<bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
using namespace std;
#define sz(x) ((int)(x).size())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define MEMSET(v, h) memset((v), h, sizeof(v))
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define pb push_back
#define mp make_pair
#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
const ll INF = 1LL<<60;
 
int main() {
	int N;
  	cin >> N;
  	string s;
  	string t;
  	int ans = s.size() + t.size();
  	int j = 0;
  	for(int i = s.size() i >= 0; --i){
      if(s[i] == t[j]){
        --ans;
        ++j;
      }
      else break;
    }
  	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:29: error: expected ';' before 'i'
   28 |         for(int i = s.size() i >= 0; --i){
      |                             ^~
      |                             ;
Language: C++

#include <iostream>
#include <algorithm>
int main(void)
{
	char s[101], t[101];
	int n, ls, lt;
	std::cin >> n >> s >> t;
	ls = std::strlen(s);
	lt = std::strlen(t);
	for(int i = std::max(ls - lt, 0); i != ls; i++){
		if(i + lt < n) continue;
		bool flg = true;
		for(int j = i; j != ls; j++){
			if(s[j] != t[j - i]){
				flg = false;
				break;
			}
		}
		if(flg){
			for(int j = 0; j != i; j++) std::cout << s[j];
			for(int j = 0; j != lt; j++) std::cout << t[j];
			std::cout << std::endl;
			return 0;
		}
	}
	std::cout << s;
	for(int i = 0; i < n - ls - lt; i++) std::cout << 'a';
	std::cout << t << std::endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:19: error: 'strlen' is not a member of 'std'; did you mean 'mbrlen'?
    8 |         ls = std::strlen(s);
      |                   ^~~~~~
      |                   mbrlen
a.cc:9:19: error: 'strlen' is not a member of 'std'; did you mean 'mbrlen'?
    9 |         lt = std::strlen(t);
      |                   ^~~~~~
      |                   mbrlen
Language: C++

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

int main(){
  int n,count=0;
  cin >> n;
  string s,t;
  cin >> s >> t;
  for(i=0;i<n;i++){
    if(s[n-1-i]==t[i])count++;
    else break;
  }
  cout << 2*n-count << endl;
}
 

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

#include<iostream>
#include<string>
#include<algorithm>
#include<bits/stdc++.h>
#include<vector>
 
using namespace std;
 
int main() {
  int N,co=0;
  cin >> N;
  string s,t;
  cin >> s >> t;
  for(int i=1; i<=N; i++){
    if(s.substr(N-i)==t.substr(0.i)) co=i;
  }
  cout << 2*N-co << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:32: error: cannot convert 'std::complex<double>' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'}
   15 |     if(s.substr(N-i)==t.substr(0.i)) co=i;
      |                                ^~~
      |                                |
      |                                std::complex<double>
In file included from /usr/include/c++/14/string:54,
                 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/basic_string.h:3208:24: note:   initializing argument 1 of 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::substr(size_type, size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
 3208 |       substr(size_type __pos = 0, size_type __n = npos) const
      |              ~~~~~~~~~~^~~~~~~~~
Language: C++

n=int(input())
s=input()
t=input()
k=n
for i in range(n):
  if(s[i:]==t[:n-i]):
    k=i
    break
print(n+k)

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

#define debug_interval ','
#define dump_interval ' '
#define debug_toggle 1
//{
#include<bits/stdc++.h>
using namespace std;
#define hi cerr<<"hi"<<endl;
#define int long long
#define INT_MAX LLONG_MAX
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep1(i,n) for(int i=1;i<=(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define fi first
#define se second
#define mp make_pair
#define rev reverse
#define dans dump(ans)
#define MOD 1000000007
#define amp(v,n) (v).count(n)?v[n]++:v[n]=1
#define sysp system("pause")
#define PI acos(-1)
#define pf push_front

//{
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();}
template<class...A> inline void dump(){cout<<endl;}
template<class...A> inline void dump_rest() {cout<<endl;}
template<class T, class...A> inline void dump_rest(const T& first, const A&... rest){cout<<dump_interval<<first;dump_rest(rest...);}
template<class T,class...A> inline void dump(const T&first,const A&...rest){cout<<first;dump_rest(rest...);}
template<class...A> inline void debug(){cerr<<endl;}
template<class...A> inline void debug_rest() {cerr<<endl;}
template<class T, class...A> inline void debug_rest(const T& first, const A&... rest){cerr<<debug_interval<<first;debug_rest(rest...);}
template<class T,class...A> inline void debug(const T&first,const A&...rest){if(debug_toggle)cerr<<first,debug_rest(rest...);}
//}

typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}
template<int m>class mint{private:int i;public:mint() : i(0){}mint(int i): i((i%m+m)%m){}mint operator+(const mint& o){return o.i+i;}mint operator*(const mint& o){return o.i*i;}mint operator-(){return -i;}operator int() {return i;}};

int n;
string s,t;

main(){
	cin>>n>>s>>t;
	n*=2;
	rev(sll(s));
	rep(i,n){
		if(s[i]==t[i])n--;
		else break;
	}
	dump(n);
}

Compiler output:
a.cc:9:9: warning: "INT_MAX" redefined
    9 | #define INT_MAX LLONG_MAX
      |         ^~~~~~~
In file included from /usr/include/c++/14/climits:42,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:38,
                 from a.cc:5:
/usr/lib/gcc/x86_64-linux-gnu/14/include/limits.h:120:9: note: this is the location of the previous definition
  120 | #define INT_MAX __INT_MAX__
      |         ^~~~~~~
a.cc:50:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   50 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:53:13: error: 'sll' was not declared in this scope; did you mean 'all'?
   53 |         rev(sll(s));
      |             ^~~
      |             all
Language: C

/*

結果:
*/
#define _USE_MATH_DEFINES
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <limits.h>  
#include <stdbool.h>   
#define inf (INT_MAX-1)
#define INF 9223372036854775807
#define PI 3.14159265358979323846;
#define EPS 1e-10
#define sq(n) ((n)*(n))
#define rep(i,n) for(i=0;i<n;i++)
#define rev(i,n) for(i=n-1;i>=0;i--)
/*
#define sort(a,n) qsort(a,n,sizeof(TYPE),cmp)
#define sort_r(a,n) qsort(a,n,sizeof(TYPE),cmp_r)
*/
#define chsort(s,n) qsort(s,n,sizeof(char),cmp)
#define chsort_r(s,n) qsort(s,n,sizeof(char),char_cmp_r)
#define TYPE long long
#define ll long long
#define MEMSET(a) memset(a,0,sizeof(a))
#define MEMSET_U(a) memset(a,-1,sizeof(a))
const int mod = (int)1e09 + 7;

//#define DEBUG1
//#define DEBUG2
//#define DEBUGF
#define DUMMY

int in(void) { int i; scanf("%d", &i); return i; }
long long llin(void) { long long i; scanf("%lld", &i); return i; }
double din(void) { double i; scanf("%lf", &i); return i; }
void chin(char s[]) { scanf("%s", s); }

void print(int a) { printf("%d\n", a); }
void llprint(long long a) { printf("%lld\n", a); }
void dprint(double a) { printf("%.10f\n", a); }
void print2(int a, int b) { printf("%d %d\n", a, b); }
int Max(int a, int b) { if (a > b) { return a; }return b; }
int Min(int a, int b) { if (a < b) { return a; }return b; }
long long llmax(long long a, long long b) { return a > b ? a : b; }
long long llmin(long long a, long long b) { return a < b ? a : b; }
double dmax(double a, double b) { return a > b ? a : b; }
double dmin(double a, double b) { return a < b ? a : b; }
//long long llmax(long long a, long long b) { return a > b ? a : b; }
//long long llmin(long long a, long long b) { return a < b ? a : b; }
//double dmax(double a, double b) { return a > b ? a : b; }
int cmp(const void *a, const void *b) { return *(TYPE *)a - *(TYPE *)b; }
int cmp_r(const void *a, const void *b) { return *(TYPE *)b - *(TYPE *)a; }
int char_cmp(const void *a, const void *b) { return strcmp((char *)a, (char *)b); }
int char_cmp_r(const void *a, const void *b) { return strcmp((char *)b, (char *)a); }
void swap(int *a, int *b) { int t = *a; *a = *b; *b = t; }


int N;
char S[101], T[101];
int ans;

int same(int d) {
	for (int i = 0; i < N-d; i++) {
		if (S[i + d] != T[]) {
			return 0;
		}
	}
	return 1;
}

int main() {
	scanf("%d", &N);
	scanf("%s%s", S, T);

	int d = 0;
	for (d = 0; d < N; d++) {
		if (same(d)) {
			break;
		}
	}

	ans = N + d;
	printf("%d\n", ans);

#ifdef DEBUGF
	getch();
#endif
	return 0;
}

Compiler output:
main.c: In function 'same':
main.c:67:35: error: expected expression before ']' token
   67 |                 if (S[i + d] != T[]) {
      |                                   ^
Language: C++

#include <bits/stdc++.h>
#include <unordered_set>
using namespace std;
#define ll long long
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define repeat(i,s,n) for(int (i)=s; (i)<(n); (i)++)
#define revrep(i,n) for(int (i)=(n)-1;i>=0; i--)

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout<<setprecision(std::numeric_limits<float>::max_digits10);
  int n;
  cin>>s>>t;
  reverse(s.begin(),s.end());
  int c=0;
  rep(i,n) {
    if(s[i]==t[i]) c++;
    else break;
  }
  cout << s.size()+t.size()-c << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:8: error: 's' was not declared in this scope
   14 |   cin>>s>>t;
      |        ^
a.cc:14:11: error: 't' was not declared in this scope
   14 |   cin>>s>>t;
      |           ^
Language: C++

#include<algorithm>
#include<iostream>
using namespace std;
int main(){

int N,x,i;
  cin>>N>>x;
  if(x!=N){
  cout<<"No"<<endl;
  }
  else{
  cout<<"Yes"<<endl;
    REP(i,1,2*N+2){
    cout<<i<<endl;
    }
    
  }
  return 0;
  

}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'REP' was not declared in this scope
   13 |     REP(i,1,2*N+2){
      |     ^~~
Language: C++

#include <cstdio>
#include <iostream>
using namespace std;
char a[200], b[200];
int n;
inline int lcp() {
	int ans = 0;
	for(int i = 1; i <= n; i ++ ) {
		if(a[i] == b[i]) ans ++;
		else break;
	}
	return ans;
}
int main() {
	scanf("%d%s%s", &n, a+1, b+1);
	reverse(a+1, a+n+1);
	printf("%d\n", n*2-lcp());
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: 'reverse' was not declared in this scope
   16 |         reverse(a+1, a+n+1);
      |         ^~~~~~~
Language: C++

#include <cstdio>
#include <iostream>
char a[200], b[200];
int n;
inline int lcp() {
	int ans = 0;
	for(int i = 1; i <= n; i ++ ) {
		if(a[i] == b[i]) ans ++;
		else break;
	}
	return ans;
}
int main() {
	scanf("%d%s%s", &n, a+1, b+1);
	std :: reverse(a+1, a+n+1);
	printf("%d\n", n*2-lcp());
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:16: error: 'reverse' is not a member of 'std'
   15 |         std :: reverse(a+1, a+n+1);
      |                ^~~~~~~
Language: C++

#include<stdio.h>
#define dn(i,j) (a[i]<=k && a[j]<=k)
#define up(i,j) (k<a[i] && k<a[j])

int a[200005],n,l,r,mid;

inline bool judge(const int &k)
{
    if (dn(n-1,n) || dn(n,n+1)) return 1;
    if (up(n-1,n) || up(n,n+1)) return 0;
    for (int i=1;i<n-1;i++)
    {
        if (dn(n+i,n+i+1) || dn(n-i,n-i-1)) return 1;
        if (up(n+i,n+i+1) || up(n-i,n-i-1)) return 0;
    }
    return dn(1,1);
}

int main()
{
    scanf("%d",&n);
    for (int i=1;i<n<<1;i++) scanf("%d",a+i);
    for (r=(n<<1)-1,mid=l+r>>1;l<r;mid=l+r>>1) if (judge(mid)) r=mid;else l=mid+1;
    printf("%d",l);
}
1

Compiler output:
a.cc:26:1: error: expected unqualified-id before numeric constant
   26 | 1
      | ^
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
using namespace std;
using ll =int long long;
map <int ,int> mpa,mpb;

string s,t;
int i,j;
string toru(string x, int i, int j){
  string p=x.substring(i,j)
  return p;
}

int main(void){
  int N;
  cin >>N;
  cin >> s >> t;
  int ans=0;
  for(int k=0; k<N ;k++){
    if(toru(s,k,N-k)==toru(t,0,N-k)){
      cout << N+k;
      return 0;
    }
  }
}

Compiler output:
a.cc: In function 'std::string toru(std::string, int, int)':
a.cc:18:14: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'substring'; did you mean 'substr'?
   18 |   string p=x.substring(i,j)
      |              ^~~~~~~~~
      |              substr
a.cc:20:1: warning: no return statement in function returning non-void [-Wreturn-type]
   20 | }
      | ^
Language: C++

4
expr
expr#include <bits/stdc++.h>
#include <array>
using namespace std;
typedef long long ll;
#define tr(container, it) \
	for (auto it = container.begin(); it != container.end(); it++)
#define scontains(c,x) ((c).find(x) != (c).end())   //O(log n) 
#define contains(c,x) (find((c).begin(),(c).end(),x) != (c).end()) //O(n)
#define Ichar(_x) char _x;scanf("%c",&_x);
#define Iint(_x) int _x;scanf("%d",&_x); 
#define Ill(_x)  ll _x;scanf("%lld",&_x);
#define inc(a,b,x)(x)>a && (x)<b	
#define incE(a,b,x)(x)>=a && (x)<=b	
//freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);

int main()
{
	Iint(n);
	string s, t;
	std::cin >> s >>t;
	int mx = 0;
	for (int i = n; i >= n; --i)
	{
		if(t.substr(0,i)==s.substr(n-i,i))
		{
			mx = i;
			break;
		}
	}
	std::cout << 2*n-mx;

	



}











Compiler output:
a.cc:3:5: error: stray '#' in program
    3 | expr#include <bits/stdc++.h>
      |     ^
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 4
      | ^
In file included from /usr/include/c++/14/array:39,
                 from a.cc:4:
/usr/include/c++/14/initializer_list:51:15: error: 'size_t' does not name a type
   51 |       typedef size_t            size_type;
      |               ^~~~~~
/usr/include/c++/14/initializer_list:1:1: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
  +++ |+#include <cstddef>
    1 | // std::initializer_list support -*- C++ -*-
/usr/include/c++/14/initializer_list:57:7: error: 'size_type' does not name a type
   57 |       size_type                 _M_len;
      |       ^~~~~~~~~
/usr/include/c++/14/initializer_list:60:54: error: 'size_type' has not been declared
   60 |       constexpr initializer_list(const_iterator __a, size_type __l)
      |                                                      ^~~~~~~~~
/usr/include/c++/14/initializer_list:68:17: error: 'size_type' does not name a type
   68 |       constexpr size_type
      |                 ^~~~~~~~~
/usr/include/c++/14/initializer_list:45:11: fatal error: definition of 'class std::initializer_list<_E>' does not match '#include <initializer_list>'
   45 |     class initializer_list
      |           ^~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

class KMP:
    pattern = None
    length = -1
    failed = None
    def __init__(self, pattern):
        self.pattern = pattern
        self.length = len(pattern)
        self.failed = [-1 for i in xrange(self.length)]
        for i in xrange(1, self.length):
            prev = self.failed[i-1]
            while prev!=-1 and pattern[prev+1]!=pattern[i]:
                prev = self.failed[i-1]
            if pattern[prev+1]==pattern[i]:
                prev += 1
            self.failed[i] = prev

def minimumLen(s, t):
    kmp = KMP(t)
    offset = -1
    for c in s:
        while offset!=-1 and kmp.pattern[offset+1]!=c:
            offset = kmp.failed[offset]
        if kmp.pattern[offset+1]==c:
            offset += 1
    return len(s)+len(t)-(offset+1)

def main():
    n = int(raw_input().strip())
    s = raw_input().strip()
    t = raw_input().strip()
    return
    print minimumLen(s, t)

if __name__ == '__main__':
    main()

Compiler output:
a.cc:34:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
   34 | if __name__ == '__main__':
      |                ^~~~~~~~~~
a.cc:2:13: error: expected class-name before '=' token
    2 |     pattern = None
      |             ^
a.cc:2:13: error: expected '{' before '=' token
a.cc:2:13: error: expected unqualified-id before '=' token
Language: C

#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <fstream>
#include <string> 
#include <cmath>  
#include <cstdlib>
#include <ctime>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <functional>


int descending_compare(const void *a, const void *b) {
	if (*(int*)a > *(int*)b) {
		return -1;
	}
	else if (*(int*)a == *(int*)b) {
		return 0;
	}
	else {
		return 1;
	}
}

int ascending_compare(const void *a, const void *b) {
	if (*(int*)a < *(int*)b) {
		return -1;
	}
	else if (*(int*)a == *(int*)b) {
		return 0;
	}
	else {
		return 1;
	}
}

//greatest common divisor
unsigned long  gcd(unsigned long x, unsigned long y) {
	if (y == 0) {
		return x;
	}
	else if (x > y) {
		return gcd(y, x % y);
	}
	else {
		return gcd(x, y % x);
	}
}



long long factorial(int x) {
	long long rtn = 1;
	int i;
	for (i = x; i > 1; i--) {
		rtn = (rtn*i);
	}
	return rtn;
}

/*
int struct_ascending_compare(const void *p, const void *q) {
return ((struct_name*)p)->member_name - ((struct_name*)q)->member_name;
}*/

int main(void) {
	int n;
	char s[105];
	char t[105];
	scanf("%d", &n);
	scanf("%s", s);
	scanf("%s", t);
	int len = strlen(s);
	int match = len;
	for (int i = 0; i < len; i++)
	{
		int flag = 1;
		for (int j = 0; j < len - i; j++)
		{
			if (s[i + j] != t[j]) {
				flag = 0;
			}
		}
		if (flag == 1)
		{
			match = i;
		}
	}
	int tlen = strlen(t);
	printf("%d\n", match + tlen);
	return 0;
}


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

#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <fstream>
#include <string> 
#include <cmath>  
#include <cstdlib>
#include <ctime>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <functional>


int descending_compare(const void *a, const void *b) {
	if (*(int*)a > *(int*)b) {
		return -1;
	}
	else if (*(int*)a == *(int*)b) {
		return 0;
	}
	else {
		return 1;
	}
}

int ascending_compare(const void *a, const void *b) {
	if (*(int*)a < *(int*)b) {
		return -1;
	}
	else if (*(int*)a == *(int*)b) {
		return 0;
	}
	else {
		return 1;
	}
}

//greatest common divisor
unsigned long  gcd(unsigned long x, unsigned long y) {
	if (y == 0) {
		return x;
	}
	else if (x > y) {
		return gcd(y, x % y);
	}
	else {
		return gcd(x, y % x);
	}
}



long long factorial(int x) {
	long long rtn = 1;
	int i;
	for (i = x; i > 1; i--) {
		rtn = (rtn*i);
	}
	return rtn;
}

/*
int struct_ascending_compare(const void *p, const void *q) {
return ((struct_name*)p)->member_name - ((struct_name*)q)->member_name;
}*/

int main(void) {
	int n;
	char s[105];
	char t[105];
	scanf("%d", &n);
	scanf("%s", s);
	scanf("%s", t);
	int len = strlen(s);
	int match = len;
	for (int i = 0; i < len; i++)
	{
		int flag = 1;
		for (int j = 0; j < len - i; j++)
		{
			if (s[i + j] != t[j]) {
				flag = 0;
			}
		}
		if (flag == 1)
		{
			match = i;
		}
	}
	int tlen = strlen(t);
	printf("%d\n", match + tlen);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:78:19: error: 'strlen' was not declared in this scope
   78 |         int len = strlen(s);
      |                   ^~~~~~
a.cc:16:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   15 | #include <functional>
  +++ |+#include <cstring>
   16 |
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define each(itr,v) for(auto itr:v)
#define pb(s) push_back(s)
#define maxch(x,y) x=max(x,y)
#define minch(x,y) x=min(x,y)
#define mp(a,b) make_pair(a,b)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define maxch(x,y) x=max(x,y)
#define minch(x,y) x=min(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
template<class T,class U>inline void chmin(T &t,U f){if(t>f)t=f;}
template<class T,class U>inline void chmax(T &t,U f){if(t<f)t=f;}
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) > (b) ? (b) : (a))

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
typedef pair<P, int> PPI;

#define INF INT_MAX/3
#define MAX_N 1000
ll n;
string s,t;
void solve(){
   cin.tie(0);
  ios::sync_with_stdio(false);
  cin>>n>>s>>t;
  ll dp[200][200];
  rep(j,s.size())rep(i,t.size()){
    if(s[j]==t[i]) dp[i+1][j+1]  = dp[i][j] + 1;
    else dp[i+1][j+1]  = max(dp[i][j+1],dp[i+1][j]);
  }
  // max(n,s.size()+t.size() - dp[s.size()][t.size()])
  ll ans;
  if(n > s.size()+t.size() - dp[s.size()][t.size()]) ans = n;
  else ans = s.size()+t.size() - dp[s.size()][t.size()]
  cout<<ans<<endl;
}
int main(){
  solve();
  return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:43:56: error: expected ';' before 'cout'
   43 |   else ans = s.size()+t.size() - dp[s.size()][t.size()]
      |                                                        ^
      |                                                        ;
   44 |   cout<<ans<<endl;
      |   ~~~~
Language: Java

import java.util.Scanner;

public class gMain {
	public static void main(String[] args) {
		final Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String s1 = sc.next();
		String s2 = sc.next();
		int ans = 2*n;
		for(int i = n-1; i >= 0; i--) {
			if(s2.startsWith(s1.substring(i))) {
				ans -= (n-i);
				System.out.println(ans);
				return;
			}
		}
	}
}


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

#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
typedef long long ll;
int main() {
	int n; cin >> n;
	string s, t; cin >> s >> t;
	string ans = s + t;
	for (int i = 1; i <= n; i++) 
		if (s.substr(n - i, i) == t.substr(0, i))ans = s.substr(0, n - i) + t;
	cout << ans << endl;
}#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
typedef long long ll;
int main() {
	int n; cin >> n;
	string s, t; cin >> s >> t;
	string ans = s + t;
	for (int i = 1; i <= n; i++) 
		if (s.substr(n - i, i) == t.substr(0, i))ans = s.substr(0, n - i) + t;
	cout << ans << endl;
}

Compiler output:
a.cc:13:2: error: stray '#' in program
   13 | }#include<iostream>
      |  ^
a.cc:13:3: error: 'include' does not name a type
   13 | }#include<iostream>
      |   ^~~~~~~
a.cc:18:5: error: redefinition of 'int main()'
   18 | int main() {
      |     ^~~~
a.cc:6:5: note: 'int main()' previously defined here
    6 | int main() {
      |     ^~~~
Language: C++



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

int main()
{
	unsigned N;
	string s, n;

	cin >> N;
	cin >> s;
	cin >> n;

	unsigned cur = 0;
	for( unsigned i = 0 ; i < s.length() ; i++)
	{
		if (s[i] == n[cur])
			cur++;
		else
			cur = 0;
	}


	cout << std::max(s.length() + n.length() - cur, N);


}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:25: error: no matching function for call to 'max(std::__cxx11::basic_string<char>::size_type, unsigned int&)'
   27 |         cout << std::max(s.length() + n.length() - cur, N);
      |                 ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from a.cc:3:
/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:   template argument deduction/substitution failed:
a.cc:27:25: note:   deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'unsigned int')
   27 |         cout << std::max(s.length() + n.length() - cur, N);
      |                 ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:5:
/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:   candidate expects 1 argument, 2 provided
/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:   template argument deduction/substitution failed:
a.cc:27:25: note:   mismatched types 'std::initializer_list<_Tp>' and 'long unsigned int'
   27 |         cout << std::max(s.length() + n.length() - cur, N);
      |                 ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

//


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

int main()
{
	unsigned N;
	string s, n;

	cin >> N;
	cin >> s;
	cin >> n;

	int cur = 0;
	for( unsigned i = 0 ; i < s.length() ; i++)
	{
		if (s[i] == n[cur])
			cur++;
		else
			cur = 0;
	}


	cout << max(s.length() + n.length() - cur, N);


}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:20: error: no matching function for call to 'max(std::__cxx11::basic_string<char>::size_type, unsigned int&)'
   28 |         cout << max(s.length() + n.length() - cur, N);
      |                 ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from a.cc:4:
/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:   template argument deduction/substitution failed:
a.cc:28:20: note:   deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'unsigned int')
   28 |         cout << max(s.length() + n.length() - cur, N);
      |                 ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:6:
/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:   candidate expects 1 argument, 2 provided
/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:   template argument deduction/substitution failed:
a.cc:28:20: note:   mismatched types 'std::initializer_list<_Tp>' and 'long unsigned int'
   28 |         cout << max(s.length() + n.length() - cur, N);
      |                 ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
#include<debug.h>
#define LL long long
using namespace std;
string pi(string x,string y)
{
    int mx=0,c=0;
    string s=y+"#"+x;
    vector<int>pi(s.length());
    for(int i=1,j=0;i<s.length();i++)
    {
        while(j&&s[i]!=s[j])j=pi[j-1];
        if(s[i]==s[j])j++;
        pi[i]=j;
        if(j==(int)y.size())return x;
    }
    return x.substr(0,x.size()-pi.back())+y;
}
int main()
{
    int n; string s,t;
    cin>>n>>s>>t;
    cout<<pi(s,t).size();
}


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

#include<functional>
#include<random>
#include<unordered_set>
using namespace std;
typedef long long int llint;
#define mp make_pair
#define mt make_tuple
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define fir first
#define sec second
#define res resize
#define ins insert
#define era erase
const llint mod=1000000007;
const llint big=1e17-10;
const long double pai=3.141592653589793238462643383279;
template <class T,class U>void mineq(T& a,U b){if(a>b){a=b;}}
template <class T,class U>void maxeq(T& a,U b){if(a<b){a=b;}}
int main(void){
	int i,j,n;cin>>n;
	string s,t;cin>>s>>t;
	string ans;
	for(i=0;i<=n;i++){
		int ok=0;
		for(j=0;i+j<n;j++){if(s[i+j]!=t[j]){ok=1;break;}}
		if(ok==1){continue;}
		for(j=0;j<n;j++){cout<<s[j];}
		for(j=n-i;j<n;j++){cout<<t[j];}
		break;
	}
	cout<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:19: error: 'cin' was not declared in this scope
   23 |         int i,j,n;cin>>n;
      |                   ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #include<unordered_set>
  +++ |+#include <iostream>
    4 | using namespace std;
a.cc:30:34: error: 'cout' was not declared in this scope
   30 |                 for(j=0;j<n;j++){cout<<s[j];}
      |                                  ^~~~
a.cc:30:34: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:31:36: error: 'cout' was not declared in this scope
   31 |                 for(j=n-i;j<n;j++){cout<<t[j];}
      |                                    ^~~~
a.cc:31:36: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:34:9: error: 'cout' was not declared in this scope
   34 |         cout<<endl;
      |         ^~~~
a.cc:34:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:34:15: error: 'endl' was not declared in this scope
   34 |         cout<<endl;
      |               ^~~~
a.cc:4:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    3 | #include<unordered_set>
  +++ |+#include <ostream>
    4 | using namespace std;
Language: C++

    #include <bits/stdc++.h>
    using namespace std;
     
    int main(void)
    {
    int n, x, ans;
    string s,t;
     
    cin >> n >> x;
    cin >> s >> t;
     
    for(int i = 1; i <= n; i++) 
    {
    for(int j = 0; j < i)
    {
    if(a[n - i + j] != b[j]) break;
    }
    else
    {
    ans = n*2 - i;
    }
    }
    cout << ans << endl;
    return 0;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:14:25: error: expected ';' before ')' token
   14 |     for(int j = 0; j < i)
      |                         ^
      |                         ;
a.cc:16:8: error: 'a' was not declared in this scope
   16 |     if(a[n - i + j] != b[j]) break;
      |        ^
a.cc:16:24: error: 'b' was not declared in this scope
   16 |     if(a[n - i + j] != b[j]) break;
      |                        ^
a.cc:18:5: error: 'else' without a previous 'if'
   18 |     else
      |     ^~~~