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

a=list(input())
b=list(input())
from collections import Counter
def f(s):
    return sorted(Counter(s).values())
if f(a)==f(b):
    print("Yes")
else:
    print("No")

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

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



string Comp(int x[26], int y[26]){
    string flag = "Yes";
    bool boo = false;
    for(int i = 0; i < 26; ++i){
        if(x[i] == 0){
            boo = true;
        }
    }
    
    if(boo){
        for(int i = 0; i < 26; ++i){
            for(int j = 0; j < 26; ++j){
                if(x[i] == y[j]){
                    y[j] = -1;
                    break;
                }
            }
        }
        for(int i = 0; i < 26; ++i){
                if(y[i] != -1){
                    flag = "No";
                }
        }
    } else {
        sort(x, x+26);
        sort(y, y+26);
        int num = -1;
        int num_count = 0;
        for(int i = 0; i < 26; ++i){
            cout << x[i] << " ";
            for(int j = 0; j < 26; ++j){
                if(x[i] == y[j]){
                    y[j] = -1;
                }
            }
            if(num == x[i]){
                ++num_count;
            } else {
                if(num_count % 2 == 1){
                    flag = "No";
                    return flag;
                }
                num = x[i];
                num_count = 1;
            }
            
        }
    }
    return flag;
}

int main() {
    string S, T;
    cin >> S >> T;
    
    const int sizeS = S.length();
    const int sizeT = T.length();
    
    int listS[26];
    int listT[26];
    
//    cout << sizeS << sizeT << endl;
    
    int i = 0;
    for(char alph = 'a'; alph <='z'; ++alph){
        int count = 0;
        for(int j = 0; j < sizeS; ++j){
            if(alph == S[j]){
                ++count;
            }
        }
        listS[i] = count;
//        cout << count << " ";
        ++i;
    }
//    cout << endl;
    
    i = 0;
    for(char alph = 'a'; alph <='z'; ++alph){
        int count = 0;
        for(int j = 0; j < sizeT; ++j){
            if(alph == T[j]){
                ++count;
            }
        }
        listT[i] = count;
//        cout << count << " ";
        ++i;
    }
    
    cout << Comp(listS, listT) << endl;
    
    return 0;
}

Compiler output:
a.cc: In function 'std::string Comp(int*, int*)':
a.cc:31:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   31 |         sort(x, x+26);
      |         ^~~~
      |         short
Language: C++

#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

int main(){
    string x, y;
    int z[256] = {};
    int zz[256] = {};
    cin >> x >> y;
    for(int a = 0; a < (int)x.size(); a++){
        if(z[(int)x[a]] == 0) z[(int)x[a]] = (int)y[a];
        else if(z[(int)x[a]] != (int)y[a]{
            cout << "No" << endl;
            return 0;
        }
        if(z[(int)y[a]] == 0) z[(int)y[a]] = (int)x[a];
        else if(z[(int)y[a]] != (int)x[a]){
            cout << "No" << endl;
            return 0;
        }
    }

    cout << "Yes" << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:42: error: expected ';' before '{' token
   14 |         else if(z[(int)x[a]] != (int)y[a]{
      |                                          ^
      |                                          ;
a.cc:18:9: error: expected primary-expression before 'if'
   18 |         if(z[(int)y[a]] == 0) z[(int)y[a]] = (int)x[a];
      |         ^~
a.cc:17:10: error: expected ')' before 'if'
   17 |         }
      |          ^
      |          )
   18 |         if(z[(int)y[a]] == 0) z[(int)y[a]] = (int)x[a];
      |         ~~
a.cc:14:16: note: to match this '('
   14 |         else if(z[(int)x[a]] != (int)y[a]{
      |                ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
  string s, t;
  cin >> s >> t;
  
  vector< int > ck( s.size );

  for ( int i = 0; i < s.size; i++ ){
    if( s[ i ] != t[ i ] ){
      char tmp = s[ i ];
      s[ i ] = t[ i ];
      ck.at( i ) = 1;
      for ( int j = 0; j < s.size; j++ ){
        if ( s[ j ] == tmp ){
          s[ j ] = t[ i ];
          if ( ck.at( j ) ){
            cout << "No" << endl;
          }
        } else if ( s[ j ] == t[ i ] ){
          s[ j ] = tmp;
          if ( ck.at( j ) ){
            cout << "No" << endl;
          }
        }
      }
    }
  }
  for ( int i = 0; i < s.size; i++ ){
    if( s[ i ] != t[ i ] ){
      cout << "No" << endl;
    }
  }
  cout << "Yes" << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:23: error: invalid use of non-static member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
    9 |   vector< int > ck( s.size );
      |                     ~~^~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:1076:7: note: declared here
 1076 |       size() const _GLIBCXX_NOEXCEPT
      |       ^~~~
a.cc:11:26: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   11 |   for ( int i = 0; i < s.size; i++ ){
      |                        ~~^~~~
      |                              ()
a.cc:16:30: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   16 |       for ( int j = 0; j < s.size; j++ ){
      |                            ~~^~~~
      |                                  ()
a.cc:31:26: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   31 |   for ( int i = 0; i < s.size; i++ ){
      |                        ~~^~~~
      |                              ()
Language: C++

#include<iostream>
#include<stdio.h>
#include<string>
#include<vector>
#include<utility>
#include<algorithm>

#define loop while(1)
#define SZ(x) ((int)(x).size())
#define tep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define pushb push_back
#define popb pop_back

#define i64 long long int
#define veci vector<int> 
#define vveci vector<VI>
#define veci64 vector<i64>

#include<Windows.h>
using namespace std;

int main()
{
	string s, t;
	cin >> s >> t;
	for (int i = 0; i < s.length(); i++) {
		char ch = t[i];
		for (int j = 0; j < t.length(); j++) {
			if (ch== t[j]) {
				t[j] = s[i];
			}
		}
	}
	if (s == t)cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}


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

#include<cstdio>
#include<cstring>
char a[1000000],b[1000000];
int c[26][2],k,l;
int main()
{
    gets(a);
    gets(b);
	l=strlen(a);
	for(int i=0;i<l;i++)
	{
		if(a[i]=='a') c[1][1]++;
		else if(a[i]=='b') c[2][1]++;
		else if(a[i]=='c') c[3][1]++;
		else if(a[i]=='d') c[4][1]++;
		else if(a[i]=='e') c[5][1]++;
		else if(a[i]=='f') c[6][1]++;
		else if(a[i]=='g') c[7][1]++;
		else if(a[i]=='h') c[8][1]++;
		else if(a[i]=='i') c[9][1]++;
		else if(a[i]=='j') c[10][1]++;
		else if(a[i]=='k') c[11][1]++;
		else if(a[i]=='l') c[12][1]++;
		else if(a[i]=='m') c[13][1]++;
		else if(a[i]=='n') c[14][1]++;
		else if(a[i]=='o') c[15][1]++;
		else if(a[i]=='p') c[16][1]++;
		else if(a[i]=='q') c[17][1]++;
		else if(a[i]=='r') c[18][1]++;
		else if(a[i]=='s') c[19][1]++;
		else if(a[i]=='t') c[20][1]++;
		else if(a[i]=='u') c[21][1]++;
		else if(a[i]=='v') c[22][1]++;
		else if(a[i]=='w') c[23][1]++;
		else if(a[i]=='x') c[24][1]++;
		else if(a[i]=='y') c[25][1]++;
		else if(a[i]=='z') c[26][1]++;
		if(b[i]=='a') c[1][2]++;
		else if(b[i]=='b') c[2][2]++;
		else if(b[i]=='c') c[3][2]++;
		else if(b[i]=='d') c[4][2]++;
		else if(b[i]=='e') c[5][2]++;
		else if(b[i]=='f') c[6][2]++;
		else if(b[i]=='g') c[7][2]++;
		else if(b[i]=='h') c[8][2]++;
		else if(b[i]=='i') c[9][2]++;
		else if(b[i]=='j') c[10][2]++;
		else if(b[i]=='k') c[11][2]++;
		else if(b[i]=='l') c[12][2]++;
		else if(b[i]=='m') c[13][2]++;
		else if(b[i]=='n') c[14][2]++;
		else if(b[i]=='o') c[15][2]++;
		else if(b[i]=='p') c[16][2]++;
		else if(b[i]=='q') c[17][2]++;
		else if(b[i]=='r') c[18][2]++;
		else if(b[i]=='s') c[19][2]++;
		else if(b[i]=='t') c[20][2]++;
		else if(b[i]=='u') c[21][2]++;
		else if(b[i]=='v') c[22][2]++;
		else if(b[i]=='w') c[23][2]++;
		else if(b[i]=='x') c[24][2]++;
		else if(b[i]=='y') c[25][2]++;
		else if(b[i]=='z') c[26][2]++;
	}
	for(int i=1;i<=26;i++)
	{
		if(c[i][1]!=c[i][2]) k++;
	}
	if(k>2)
	{
		printf("No");
		return 0;
	}
	printf("Yes");
    return 0;
}

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

#include <iostream>
#include <stdio.h>
#include <unordered_map>

using namespace std;

int main(){

    string S;
    string T;
    string tmp;
    string tmp2;
    string ans;

    unordered_map<string, int> mp_S;
    unordered_map<string, int> mp_T;

    cin >> S;
    cin >> T;
 
    int num_C;
    int si = 0;

    ans = "Yes";
    num_C = 0;

    tmp = S[si];
    mp_S[tmp] = num_C;
    tmp = T[si];
    mp_T[tmp] = num_C;
    num_C++;
    for( si = 1 ; si < S.length() ; si++ ){
        tmp  = S[si];
        tmp2 = T[si];
        auto itr  = mp_S.find(tmp);        // "xyz" が設定されているか？
        auto itr2 = mp_T.find(tmp2);        // "xyz" が設定されているか？
        if( itr != mp_S.end() || itr2 != mp_T.end() ) {
            //設定されている場合の処理
            if( mp_S[tmp] != mp_T[tmp2]  ){
                ans = "No";
                   break;
            }

            if( mp_S[tmp] * mp_T[tmp2] == 0 ){
                if not ( itr != mp_S.end() && itr2 != mp_T.end() ) 
                    ans = "No";
                    break;
                }
            }
        } else {
            //設定されていない場合の処理
            mp_S[tmp] = num_C;
            mp_T[tmp2] = num_C;
            num_C++;
        }
    }

    cout << ans;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:20: error: expected '(' before 'not' token
   45 |                 if not ( itr != mp_S.end() && itr2 != mp_T.end() )
      |                    ^~~
      |                    (
a.cc:50:11: error: 'else' without a previous 'if'
   50 |         } else {
      |           ^~~~
a.cc: At global scope:
a.cc:58:5: error: 'cout' does not name a type
   58 |     cout << ans;
      |     ^~~~
a.cc:60:5: error: expected unqualified-id before 'return'
   60 |     return 0;
      |     ^~~~~~
a.cc:61:1: error: expected declaration before '}' token
   61 | }
      | ^
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main(){
    int a,b=0,c=0;
    string s,t,o,p,e;
    char c[2],d[2];
    cin>>s>>t;
    o=s;
    p=t;
    e=s;
    for (int i=0; i<s.size(); i++) {
        c[0]=s[i];
        d[0]=t[i];
        if (c[0]!=d[0]) {
            b+=1;
        
        for (int j=0; j<s.size(); j++) {
            if(s[j]==c[0])e[j]=d[0];
        }
        }
    }
    if(e==t)a=0;
    else a=1;
  for (int i=0; i<s.size(); i++) {
        c[0]=s[i];
        d[0]=t[i];
        if (c[0]!=d[0]) {
            c+=1;
        }
    if(c!=b)a+1;
    if (a==0)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}
 

Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: conflicting declaration 'char c [2]'
    7 |     char c[2],d[2];
      |          ^
a.cc:5:15: note: previous declaration as 'int c'
    5 |     int a,b=0,c=0;
      |               ^
a.cc:13:10: error: invalid types 'int[int]' for array subscript
   13 |         c[0]=s[i];
      |          ^
a.cc:15:14: error: invalid types 'int[int]' for array subscript
   15 |         if (c[0]!=d[0]) {
      |              ^
a.cc:19:23: error: invalid types 'int[int]' for array subscript
   19 |             if(s[j]==c[0])e[j]=d[0];
      |                       ^
a.cc:26:10: error: invalid types 'int[int]' for array subscript
   26 |         c[0]=s[i];
      |          ^
a.cc:28:14: error: invalid types 'int[int]' for array subscript
   28 |         if (c[0]!=d[0]) {
      |              ^
a.cc:34:2: error: expected '}' at end of input
   34 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C

#include<stdio.h>

#define SIZE 100001

int length(char s[]){
  for(int i=0; ;i++){
    if(s[i]=='\0') return i; 
  }
}

void print(int s[], int n){
  printf(">");
  for(int i=0; i<n; i++){
    printf("%d ", s[i]);
  }
  printf("\n");
}

int main(){
  int ansflag;

  //input
  char s[SIZE], t[SIZE];
  scanf("%s", s);
  scanf("%s", t);

  //length
  int len = length(s);

  //number of alphabets
  int al[30] = {0};
  for(int i=0; i<len; i++){
    al[ t[i]-'a' ]++;
  }

  /*
  printf(" ");
  for(int a=0; a<26; a++){
    printf("%c ", a+'a');
  }
  printf("\n");
  print(al, 26);

  */
  int alphas = 0;
  
  //doubling same check
  for(int a=0; a<26; a++){
    if(al[a]==0)continue;
    alphas++; //number of alphabets in T
    //printf("%c:", a+'a');
    int number[SIZE] = {0};
    int count = 0;
    for(int i=0; i<len; i++){
      if(t[i]=='a'+a){
	number[count] = i;
	count++;
	//	printf("%d ", i);n
      }  
    }
    //    printf("\n");
    char num, numprev;
    for(int i=0; i<al[a]; i++){
      if(i==0) num = s[ number[i] ];
      else if(num != s[ number[i] ]){
	ansflag = 0;	prinptf("No\n");
	return 0;
      }
    }
  }

  


  //output
  if(ansflag) printf("Yes\n");
  else  printf("No\n");

  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:66:25: error: implicit declaration of function 'prinptf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   66 |         ansflag = 0;    prinptf("No\n");
      |                         ^~~~~~~
      |                         printf
Language: C

#include <stdio.h>
#include <string.h>
int main(void)
{
    char s[2050], t[2050];
    int i, j;
    int len;
    scanf("%s\n%s", s, t);
    len = strlen(s);
    for(i = 0; i < len - 1; i++) {
        for(j = i + 1; j < len; j++) {
            if((s[i] == s[j] && t[i] != t[j]) || (t[i] == t[j] && s[i] != s[j])) {
                printf("No\n");
                return 0;
            }
        }
    }
    printf("Yes\n");   
    return 0;
}
#include <stdio.h>
#include <string.h>
int main(void)
{
    char s[20050], t[20050];
    int i, j;
    int len;
    scanf("%s\n%s", s, t);
    len = strlen(s);
    for(i = 0; i < len - 1; i++) {
        for(j = i + 1; j < len; j++) {
            if((s[i] == s[j] && t[i] != t[j]) || (t[i] == t[j] && s[i] != s[j])) {
                printf("No\n");
                return 0;
            }
        }
    }
    printf("Yes\n");   
    return 0;
}


Compiler output:
main.c:23:5: error: redefinition of 'main'
   23 | int main(void)
      |     ^~~~
main.c:3:5: note: previous definition of 'main' with type 'int(void)'
    3 | int main(void)
      |     ^~~~
Language: C

#include <stdio.h>
#include <stdlib.h>
#define MAXL 200000

int main(void){
    char s[MAXL+1], t[MAXL+1];
    int checked_s[MAXL]= {};
    int checked_t[MAXL]= {};
    int num_alphabet_s[26] = {};
    int num_alphabet_t[26] = {};
    int i, j;
    int differ = 0;

    fgets(s, stdin);
    fgets(t, stdin);

    for(i = 0; i < MAXL; i++){
        for(j = 0; j < 26; j++){
            if(s[i] == 'a' + j && checked_s[i] == 0){
                num_alphabet_s[j]++;
                checked_s[i] = 1;
            }

            if(t[i] == 'a' + j && checked_t[i] == 0){
                num_alphabet_t[j]++;
                checked_t[i] = 1;
            }

            if(checked_s[i] == 1 && checked_t[i] == 1)
                break;
        }
    }

    for(i = 0; i < MAXL; i++)[
        if(num_alphabet_s[i] != num_alphabet_t[i]){
            differ = 1;
            break;
        }
    ]

    if(differ == 0){
        printf("Yes\n");
    }else{
        printf("No\n");
    }
    
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:14: error: passing argument 2 of 'fgets' makes integer from pointer without a cast [-Wint-conversion]
   14 |     fgets(s, stdin);
      |              ^~~~~
      |              |
      |              FILE *
In file included from main.c:1:
/usr/include/stdio.h:654:47: note: expected 'int' but argument is of type 'FILE *'
  654 | extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
      |                                           ~~~~^~~
main.c:14:5: error: too few arguments to function 'fgets'
   14 |     fgets(s, stdin);
      |     ^~~~~
/usr/include/stdio.h:654:14: note: declared here
  654 | extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
      |              ^~~~~
main.c:15:14: error: passing argument 2 of 'fgets' makes integer from pointer without a cast [-Wint-conversion]
   15 |     fgets(t, stdin);
      |              ^~~~~
      |              |
      |              FILE *
/usr/include/stdio.h:654:47: note: expected 'int' but argument is of type 'FILE *'
  654 | extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
      |                                           ~~~~^~~
main.c:15:5: error: too few arguments to function 'fgets'
   15 |     fgets(t, stdin);
      |     ^~~~~
/usr/include/stdio.h:654:14: note: declared here
  654 | extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
      |              ^~~~~
main.c:34:30: error: expected expression before '[' token
   34 |     for(i = 0; i < MAXL; i++)[
      |                              ^
main.c:39:6: error: expected ';' before 'if'
   39 |     ]
      |      ^
      |      ;
   40 | 
   41 |     if(differ == 0){
      |     ~~
Language: C

#include <stdio.h>
#include <string.h>
int main(void)
{
    char s[2050], t[2050];
    int i, j;
    int len;
    scanf("%s\n%s", s, t);
    len = strlen(s);
    for(i = 0; i < len - 1; i++) {
        for(j = i + 1; j < len; j++) {
            if((s[i] == s[j] && t[i] != t[j]) || (t[i] == t[j] && s[i] != s[j])) {
                printf("No\n");
                return 0;
            }
        }
    }
    printf("Yes\n");   
    return 0;
}
#include <stdio.h>
#include <string.h>
int main(void)
{
    char s[2050], t[2050];
    int i, j;
    int len;
    scanf("%s\n%s", s, t);
    len = strlen(s);
    for(i = 0; i < len - 1; i++) {
        for(j = i + 1; j < len; j++) {
            if((s[i] == s[j] && t[i] != t[j]) || (t[i] == t[j] && s[i] != s[j])) {
                printf("No\n");
                return 0;
            }
        }
    }
    printf("Yes\n");   
    return 0;
}


Compiler output:
main.c:23:5: error: redefinition of 'main'
   23 | int main(void)
      |     ^~~~
main.c:3:5: note: previous definition of 'main' with type 'int(void)'
    3 | int main(void)
      |     ^~~~
Language: C++

#include<iostream>
#include<string>

int main() {
	std::string sr;
	std::string tr;
	std::cin >> sr>>tr;

	for (int i = 0; i < sr.size(); i++) {
		if (sr[i] != tr[i]) {
			char ch = sr[i];

	
				if (ch == sr[j]) {
					sr[j] = '1';
				}
			
				if (tr[i] == sr[j]) {
					sr[j] = ch;
				}
		
				if (sr[j] == '1') {
					sr[j] = tr[i];
				}
		
		}
	}

	//std::cout << sr << std::endl;
	//std::cout << tr << std::endl;

	std::cout << (sr==tr? "Yes":"No") << std::endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:46: error: 'j' was not declared in this scope
   14 |                                 if (ch == sr[j]) {
      |                                              ^
a.cc:18:49: error: 'j' was not declared in this scope
   18 |                                 if (tr[i] == sr[j]) {
      |                                                 ^
a.cc:22:40: error: 'j' was not declared in this scope
   22 |                                 if (sr[j] == '1') {
      |                                        ^
Language: C++

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

std::map<char, std::vector<int> > char_map;

void init_map(){
    for(char c = 'a'; c<='z'; c++){
        std::vector<int> vec;
        char_map.insert(std::make_pair(c, vec));
        //char_map.emplace_hint(char_map.end(), c, vec);
    }
}

void read_str(std::string &str){
    for(int i=0; i<str.size(); ++i){
        char_map.at(str[i]).push_back(i);
    }
}

void replace(std::string &str, char c, char r){
    /*
    for(int i=0; i<str.size(); ++i){
        if(str[i] == c){
            str[i] = r;
        }else if(str[i] == r){
            str[i] = c;
        }
    }*/
    std::vector<int> c_vec = char_map.at(c);
    std::vector<int> r_vec = char_map.at(r);
    std::vector<int> temp;
    for(int i=0; i<c_vec.size(); ++i){
        str[c_vec[i]] = r;
    }
    for(int i=0; i<r_vec.size(); ++i){
        str[r_vec[i]] = c;
    }
    temp = c_vec;
    char_map.at(c) = char_map.at(r);
    char_map.at(r) = temp;
}

std::vector<int> count(std::string str){
    std::vector<int> vec(26);
    for(int i=0; i<str.size(); i++){
        vec[str[i]-'a']++;
    }
    return vec;
}

int main(){
    std::string str1, str2;
    std::cin >> str1;
    std::cin >> str2;

    std::vector<int> vec1 = count(str1);
    std::vector<int> vec2 = count(str2);

    std::sort(vec1.begin(), vec1.end());
    std::sort(vec2.begin(), vec2.end());

    if(vec1 == vec2){
        std::cout << "Yes" << std::endl;
    }else{
        std::cout << "No" << std::endl;
    }
    /*
    init_map();
    read_str(str1);
    for(int i=0; i<str1.size(); ++i){
    //while(str1.empty() == false){
        if(str1[i] != str2[i]){
            replace(str1, str1[i], str2[i]);
            //std::cout << str1 << std::endl;
            //std::cout << str2 << std::endl;
        }
    }*/

    /*
    for(char c = 'a'; c<='z'; ++c){
        std::vector<int> vec = char_map.at(c);
        std::cout << c << ": ";
        for(int i=0; i<vec.size(); i++){
            std::cout << vec[i] << ", ";
        }
        std::cout << std::endl;
    }
    */

    //std::cout << str1 << std::endl;
    //std::cout << str2 << std::endl;
    /*
    if(str1 == str2){
        std::cout << "Yes" << std::endl;
    }else{
        std::cout << "No" << std::endl;
    }*/

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:61:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   61 |     std::sort(vec1.begin(), vec1.end());
      |          ^~~~
      |          qsort
a.cc:62:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   62 |     std::sort(vec2.begin(), vec2.end());
      |          ^~~~
      |          qsort
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
	string a,b;
	int aa[10001],bb[10001];
	cin>>a>>b;
	int len1=a.size();
	int len2=b.size();
	set<char> s1,s2;
	set<char>::iterator it;
	for(int i=0;i<len1;i++)
	s1.insert(a[i]);
	int tot1=0,tot2=0;
	for(it=s1.begin();it!=s1.end();it++)
	{
		for(int i=0;i<len1;i++)
		{
			if(*it==a[i])
			{
				aa[tot1]++;
			}
		}
		tot1++;
	}
	for(int i=0;i<len2;i++)
	s2.insert(b[i]);
	for(it=s2.begin();it!=s2.end();it++)
	{
		for(int i=0;i<len2;i++)
		{
			if(*it==b[i])
			{
				bb[tot2]++;
			}
		}
		tot2++;
	}
	if(s1.size()!=s2.size())
	cout<<"No"<<endl;
	else
	{
		for(int i=0;i<tot1;i++)
		{
			if(aa[i]==bb[i])
			{
				aa[i]==bb[i]=0;
			}
		}
		int n1=0,n2=0;
		for(int i=0;i<tot1;i++)
		{
			n1+=aa[i];
			n2+=bb[i];
		}
		if(n1!=n2)
		cout<<"No"<<endl;
		else
		cout<<"Yes"<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:38: error: lvalue required as left operand of assignment
   46 |                                 aa[i]==bb[i]=0;
      |                                 ~~~~~^~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string s, t;
  cin >> s >> t;
  vec<int> checked(s.size());
 
  for (int i = 0; i < s.size(); i++) {
    if (checked.at(i)==0){
      checked.at(i) = 1;
      char checks =  s.at(i), checkt = t.at(i);
      for (int j = i+1; j < s.size(); j++) {
        if (s.at(j) == checks) {
          checked.at(j) = 1;
          if (!((s.at(j) == checkt && t.at(j) == checks) || (s.at(j) == checks && t.at(j) == checkt))) {
            cout << "No" << endl;
            return 0;
          }
        }
      }
    }
  }
  cout << "Yes" << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'vec' was not declared in this scope
    7 |   vec<int> checked(s.size());
      |   ^~~
a.cc:7:7: error: expected primary-expression before 'int'
    7 |   vec<int> checked(s.size());
      |       ^~~
a.cc:10:9: error: 'checked' was not declared in this scope
   10 |     if (checked.at(i)==0){
      |         ^~~~~~~
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main(){
    string S,T,s,t;
    cin>>S>>T;
    for(int i=1;i<=S.size();i++){
        s=S.substr(i-1,1);
        t=T.substr(i-1,1);
            if(S.substr(k-1,1)==s){
                if(S.substr(k-1,1)!=t){
                    cout<<"No"<<endl;
                    return 0;
                }
            } 
            if(S.substr(k-1,1)==t){
                if(S.substr(k-1,1)!=s){
                    cout<<"No"<<endl;
                    return 0;
                }
            }              
    }
    cout<<"Yes"<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:25: error: 'k' was not declared in this scope
   10 |             if(S.substr(k-1,1)==s){
      |                         ^
a.cc:16:25: error: 'k' was not declared in this scope
   16 |             if(S.substr(k-1,1)==t){
      |                         ^
Language: C++

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

int main () {
  string s, t;
  cin >> s >> t;
  int ss[26]; 
  int tt[26];
  for (int i = 0; i < 26; i++) {
    ss[i] = -1;
    tt[i] = -1;  
  } 
  for (long long i = 0; i < s.size(); i++) {
    
    if (ss[s[i] - 97] != t[i] && ss[s[i] - 97] > 0) {
      cout << "No" << endl;
      return 0;
    }  
    else {
      ss[s[i] - 97] = t[i];
    }
  }
  for (int i = 0; i < 26; i++) {
    if (ss[i] > 0) {
      int sub = ss[i] - 97;
      int subsub = 1;
      set<int> xxx;
      while (1) {
        if (ss[sub] == ss[i]) {
          break;  
        } 
        else {
          if (ss[sub] < 0) {
            break;
          }
          else {
            sub = ss[sub] - 97;
            if (xxx.find(sub)) {
              cout << "No" << endl;
              return 0;  
            }
            xxx.insert(sub);
          }
        }
      }  
    }  
    if (i == 25) {
      cout << "Yes" << endl;
      break;  
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:25: error: could not convert 'xxx.std::set<int>::find(sub)' from 'std::set<int>::iterator' {aka 'std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>, std::allocator<int> >::const_iterator'} to 'bool'
   40 |             if (xxx.find(sub)) {
      |                 ~~~~~~~~^~~~~
      |                         |
      |                         std::set<int>::iterator {aka std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>, std::allocator<int> >::const_iterator}
Language: C++

#include<iostream>
#include <stdlib.h>
#include <algorithm>
#include <string>
#include <math.h>
#include <vector>
typedef long long int ll;
using namespace std;
int main(){
	string S;
	string T;
	cin >> S >> T;
	int count[26];
	int stock[26];
	int count1[26];
	int stock1[26];
	for(int i=0; i<26;i++){
		stock[i]=0;
		count[i]=0;
		stock1[i]=0;
		count1[i]=0;
	}
	for(int i=0; i<S.size();i++){
		if(S[i]!=T[i]){
			if(stock[(int)T[i]-97]==0){
				stock[(int)T[i]-97]=(int)S[i];
				count[(int)T[i]-97]++;
			}else{
				if(stock[(int)T[i]-97]!=(int)S[i]){
					count[(int)T[i]-97]++;
				}
			}
		}
	}
	for(int i=0; i<S.size();i++){
		if(S[i]!=T[i]){
			if(stock1[(int)S[i]-97]==0){
				stock1[(int)S[i]-97]=(int)T[i];
				count1[(int)S[i]-97]=++;
			}else{
				if(stock1[(int)S[i]-97]!=(int)T[i]){
					count1[(int)S[i]-97]++;
				}
			}
		}
	}
	
	for(int i=0; i<26;i++){
		if(count[i]>=2 || count1[i]>=2){
			cout << "No" << endl;
			return 0;
		}
	}
	cout << "Yes" << endl;		
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:56: error: expected primary-expression before ';' token
   39 |                                 count1[(int)S[i]-97]=++;
      |                                                        ^
Language: C++

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

int main () {
  string s, t;
  cin >> s >> t;
  int ss[26]; 
  int tt[26];
  for (int i = 0; i < 26; i++) {
    ss[i] = -1;
    tt[i] = -1;  
  } 
  for (long long i = 0; i < s.size(); i++) {
    
    if (ss[s[i] - 97] != t[i] && ss[s[i] - 97] > 0) {
      cout << "No" << endl;
      return 0;
    }  
    else {
      ss[s[i] - 97] = t[i];
    }
  }
  for (int i = 0; i < 26; i++) {
    if (ss[i] > 0) {
      int sub = ss[i] - 97;
      int subsub = 1;
      set<int> xxxx;
      while (1) {
        if (ss[sub] == ss[i]) {
          break;  
        } 
        else {
          if (ss[sub] < 0) {
            break;
          }
          else {
            sub = ss[sub] - 97;
            if (xxx.find(sub)) {
              cout << "No" << endl;
              return 0;  
            }
            xxx.insert(sub);
          }
        }
      }  
    }  
    if (i == 25) {
      cout << "Yes" << endl;
      break;  
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:17: error: 'xxx' was not declared in this scope; did you mean 'xxxx'?
   40 |             if (xxx.find(sub)) {
      |                 ^~~
      |                 xxxx
a.cc:44:13: error: 'xxx' was not declared in this scope; did you mean 'xxxx'?
   44 |             xxx.insert(sub);
      |             ^~~
      |             xxxx
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string s, t;
  cin >> s >> t;
  vec<int> checked(s.size());
 
  for (int i = 0; i < s.size(); i++) {
    if (checked.at(i)==0){
      checked.at(i) = 1;
      char checks =  s.at(i), checkt = t.at(i);
      for (int j = i+1; j < s.size(); j++) {
        if (s.at(j) == checks) {
          checked.at(j) = 1;
          if !((s.at(j) == checkt && t.at(j) == checks) || (s.at(j) == checks && t.at(j) == checkt)) {
            cout << "No" << endl;
            return 0;
          }
        }
      }
    }
  }
  cout << "Yes" << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'vec' was not declared in this scope
    7 |   vec<int> checked(s.size());
      |   ^~~
a.cc:7:7: error: expected primary-expression before 'int'
    7 |   vec<int> checked(s.size());
      |       ^~~
a.cc:10:9: error: 'checked' was not declared in this scope
   10 |     if (checked.at(i)==0){
      |         ^~~~~~~
a.cc:16:14: error: expected '(' before '!' token
   16 |           if !((s.at(j) == checkt && t.at(j) == checks) || (s.at(j) == checks && t.at(j) == checkt)) {
      |              ^
      |              (
Language: C++

#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

int main(){
    string x, y;
    int z[256] = false;
    bool zz[256] = false;
    cin >> x >> y;
    for(int a = 0; a < (int)x.size(); a++){
        if(x[a] == y[a])zz[(int)x[a]] = true;
        if(x[a] != y[a]){
            z[(int)x[a]] = true;
            z[(int)y[a]] = true;
        }
    }
    for(int b = 0; b < 256; b++){
        if(z[b] == true && zz[b] == true){
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:18: error: array must be initialized with a brace-enclosed initializer
    9 |     int z[256] = false;
      |                  ^~~~~
a.cc:10:20: error: array must be initialized with a brace-enclosed initializer
   10 |     bool zz[256] = false;
      |                    ^~~~~
Language: C++

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

string S,T;
vector<char> KS(MAX_CANON),KT(MAX_CANON);
int count_s=0,count_t=0,s,t;
int ks[MAX_CANON],kt[MAX_CANON];

bool explore_s(int x){
    for(int i=0;i<count_s;i++){
        if(S.at(x-1)==KS.at(i)){
            ks[i]++;
            s=i;
            return false;
        }
    }
    return true;
}

bool explore_t(int x){
    for(int i=0;i<count_t;i++){
        if(T.at(x-1)==KT.at(i)){
            kt[i]++;
            t=i;
            return false;
        }
    }
    return true;
}

bool dfs(int x){
    if(x==0) return true;
    if(dfs(x-1)){
        if(explore_s(x)) {
            count_s++;
            KS.at(count_s-1)=S.at(x-1);
            ks[count_s-1]=1;
        }
        if(explore_t(x)){
            count_t++;
            KT.at(count_t-1)=T.at(x-1);
            kt[count_t-1]=1;
        }
        if(count_s==count_t && ks[s]==kt[t]) return true;
    }
    return false;
}

int main(){
    cin>>S>>T;
    if(dfs(S.size())) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}


Compiler output:
a.cc:6:17: error: 'MAX_CANON' was not declared in this scope
    6 | vector<char> KS(MAX_CANON),KT(MAX_CANON);
      |                 ^~~~~~~~~
a.cc:6:31: error: 'MAX_CANON' was not declared in this scope
    6 | vector<char> KS(MAX_CANON),KT(MAX_CANON);
      |                               ^~~~~~~~~
a.cc:8:8: error: 'MAX_CANON' was not declared in this scope
    8 | int ks[MAX_CANON],kt[MAX_CANON];
      |        ^~~~~~~~~
a.cc:8:22: error: 'MAX_CANON' was not declared in this scope
    8 | int ks[MAX_CANON],kt[MAX_CANON];
      |                      ^~~~~~~~~
a.cc: In function 'bool explore_s(int)':
a.cc:13:13: error: 'ks' was not declared in this scope; did you mean 's'?
   13 |             ks[i]++;
      |             ^~
      |             s
a.cc: In function 'bool explore_t(int)':
a.cc:24:13: error: 'kt' was not declared in this scope; did you mean 't'?
   24 |             kt[i]++;
      |             ^~
      |             t
a.cc: In function 'bool dfs(int)':
a.cc:38:13: error: 'ks' was not declared in this scope; did you mean 's'?
   38 |             ks[count_s-1]=1;
      |             ^~
      |             s
a.cc:43:13: error: 'kt' was not declared in this scope; did you mean 't'?
   43 |             kt[count_t-1]=1;
      |             ^~
      |             t
a.cc:45:32: error: 'ks' was not declared in this scope; did you mean 's'?
   45 |         if(count_s==count_t && ks[s]==kt[t]) return true;
      |                                ^~
      |                                s
a.cc:45:39: error: 'kt' was not declared in this scope; did you mean 't'?
   45 |         if(count_s==count_t && ks[s]==kt[t]) return true;
      |                                       ^~
      |                                       t
Language: C

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

int main(){
  char *s = NULL;
  char *t = NULL;
  ssize_t length;

  length = getline(&s, &(size_t){4096}, stdin);
  s[length--] = '\0';
  
  length = getline(&t, &(size_t){4096}, stdin);
  t[length--] = '\0';

  //  printf("%s", s);
  //  printf("%s", t);

  //  if(strcmp(s, t) == 0){
  //printf("Yes\n");
  //return 0;
  //}

  int i, j;
  char tmp;
  for(i = 0; i < length; i++){
    for(j = i + 1; j < length; j++){
      if(s[i] > s[j]){
	tmp = s[i];
	s[i] = s[j];
	s[j] = tmp;
      }
      if(t[i] > t[j]){
	tmp = t[i];
	t[i] = t[j];
	t[j] = tmp;
      }
    }
  }

  for(i = 0; i < length - 1; i++){
    j = i + 1;
    // for(j = i + 1; j < length; j++){
      if(s[i] == s[j]){
	if(t[i] == t[j]){
	  s[i] = t[i];
	  s[j] = t[j];
	}
	//   }
  }
    //  printf("%s", s);
    //printf("%s", t);

  if(strcmp(s, t) == 0){
    printf("Yes\n");
  }
  else{
    printf("No\n");
  }

  free(s);
  free(t);

  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:65:1: error: expected declaration or statement at end of input
   65 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
	string a,b;
	int aa[10001],bb[10001];
	cin>>a>>b;
	int len1=a.size();
	int len2=b.size();
	set<char> s1,s2;
	set<char>::iterator it;
	for(int i=0;i<len1;i++)
	s1.insert(a[i]);
	int tot1=0,tot2=0;
	for(it=s1.begin();it!=s1.end();it++)
	{
		for(int i=0;i<len1;i++)
		{
			if(*it==a[i])
			{
				aa[tot1]++;
			}
		}
		tot1++;
	}
	for(int i=0;i<len2;i++)
	s2.insert(b[i]);
	for(it=s1.begin();it!=s1.end();it++)
	{
		for(int i=0;i<len2;i++)
		{
			if(*it==b[i])
			{
				bb[tot2]++;
			}
		}
		tot2++;
	}
	if(s1.size()!=s2.size())
	cout<<"No"<<endl;
	else
	{
		for(int i=0;i<tot1;i++)
		{
			if(aa[i]!=bb[i])
			{
				cout<<"No"<<endl;
				return 0;
			}
		}
		cout<<"Yes"<<endl;
	return 0;
}

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

#include <algorithm>
#include <boost/algorithm/string/replace.hpp>
#include <iostream>
#include <string>
using namespace std;

string S, T;

int main()
{
  cin >> S >> T;
  for (int i = 0; i < S.size(); i++) {
    if (S[i] == T[i]) {
      continue;
    } else {
      auto s_before = S[i];
      auto s_tmp    = ',';
      boost::replace_all(S, T[i], s_tmp);
      boost::replace_all(S, S[i], T[i]);
      boost::replace_all(S, ',', s_before);

      // replace(S.begin(), S.end(), T[i], s_tmp);
      // replace(S.begin(), S.end(), S[i], T[i]);
      // replace(S.begin(), S.end(), ',', s_before);
    }
  }

  cout << S << endl;
  cout << T << endl;
  if (S == T) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}

Compiler output:
a.cc:2:10: fatal error: boost/algorithm/string/replace.hpp: No such file or directory
    2 | #include <boost/algorithm/string/replace.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>
#include<string.h> 
int main(){
	char s1[555555],s2[555555];
	char a[1],b[1];
	gets(s1);
	gets(s2);
	int n=strlen(s1);
	bool f=true;
	for(int i=0;i<n;i++){
		a[0]=s1[i];
		b[0]=s2[i];
		for(int j=0;j<n;j++){
			if(s1[j]==a[0])
				s1[j]=b[0];
			else if(s1[j]==b[0])
				s1[j]=a[0];
			if((s2[j]==a[0]&&s1[j]!=b[0])||(s2[j]==b[0]&&s1[j]!=a[0]))
				f=false;
		}
	}
	if(f==false)
		printf("No\n");
	else
		printf("Yes\n");
} 

Compiler output:
main.c: In function 'main':
main.c:6:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
    6 |         gets(s1);
      |         ^~~~
      |         fgets
main.c:9:9: error: unknown type name 'bool'
    9 |         bool f=true;
      |         ^~~~
main.c:3:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    2 | #include<string.h>
  +++ |+#include <stdbool.h>
    3 | int main(){
main.c:9:16: error: 'true' undeclared (first use in this function)
    9 |         bool f=true;
      |                ^~~~
main.c:9:16: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:9:16: note: each undeclared identifier is reported only once for each function it appears in
main.c:19:35: error: 'false' undeclared (first use in this function)
   19 |                                 f=false;
      |                                   ^~~~~
main.c:19:35: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
Language: C++

#include<stdio.h>
#include<string.h> 
int main(){
	char s1[555555],s2[555555];
	char a[1],b[1];
	gets(s1);
	gets(s2);
	int n=strlen(s1);
	bool f=true;
	for(int i=0;i<n;i++){
		a[0]=s1[i];
		b[0]=s2[i];
		for(int j=0;j<n;j++){
			if(s1[j]==a[0])
				s1[j]=b[0];
			else if(s1[j]==b[0])
				s1[j]=a[0];
			if((s2[j]==a[0]&&s1[j]!=b[0])||(s2[j]==b[0]&&s1[j]!=a[0]))
				f=false;
		}
	}
	if(f==false)
		printf("No\n");
	else
		printf("Yes\n");
} 

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

#include<iostream>
#include<string>
using namespace std;
int main(){
  string S,T;
  cin>>S;
  cin>>T;
  for(int i=0;i<S.size();i++){
    for(int j=0;j<i;j++){
      if(S[i]==S[j]){
        if(T[i]!=T[j] && S[i]!=T[i] && S[i]!=T[j]) cout<<"No"<<endl;
        return 0;
      }
      if(T[i]==T[j]){
        if(S[i]!=S[j] && S[i]!=T[i] && S[j]!=T[]) cout<<"No"<<endl;
        return 0;
      }
    }
  }
  cout<<"Yes"<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:48: error: expected primary-expression before ']' token
   15 |         if(S[i]!=S[j] && S[i]!=T[i] && S[j]!=T[]) cout<<"No"<<endl;
      |                                                ^
Language: C++

#include <iostream>
#include <unordered_map>

using namespace std;

bool is_success(string S, string T) {
  unordered_map<char, char> replace;
  bool success = true;
  for (int i=0; i<S.length(); i++) {
    char s_ch = S[i], t_ch = T[i];
    if (replace.find(s_ch) == replace.end()) {
      // such a replacement for s_ch does not exists
      replace[s_ch] = t_ch;
      replace[t_ch] = s_ch;
    } else {
      // such a replacement exists
      if (s_ch == t_ch && replace[s_ch] != s_ch) {
        success = false;
        break;
      }
    }
  }
  return success;
}

int main() {
  string S, T;
  cin >> S >> T;

  bool success = is_success(S, T);
  reverse(S.begin(), S.end());
  reverse(T.begin(), T.end());
  success &= is_success(S, T);

  cout << ((success) ? "Yes" : "No") << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:3: error: 'reverse' was not declared in this scope
   31 |   reverse(S.begin(), S.end());
      |   ^~~~~~~
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
void swap(char *s, char c1, char c2) {
    for (char *p = s; *p; p++) {
        if (*p == c1) *p = c2;
        if (*p == c2) *p = c1;
    }
}
int main() {
    
    char s[200000], t[200000];
    
    scanf("%s%s", s, t);
    
    for (int i = 0; s[i]; i++) {
        if (s[i] != t[i]) {
            swap(s, s[i], t[i]);
        }
    }
    
    for (int i = 0; s[i]; i++) {
        if (s[i] != t[i]) {
            cout << "No" << endl;
            return;
        }
    }
    
    cout << "Yes" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:13: error: return-statement with no value, in function returning 'int' [-fpermissive]
   25 |             return;
      |             ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
 string S,T;cin>>S>>T;int c=0;
  for(int i=0;i<S.size();i++){
    if(c!==0){break;}
    for(int j=i+1;j<S.size();j++){
      if(S[i]==S[j]&&T[i]!=T[j]){c++;break;}
      if(T[i]==T[j]&&S[i]!=S[j]){c++;break;}}}
  
  if(c==0){cout<<"Yes"<<endl;}
  else{cout<<"No"<<endl;}}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:11: error: expected primary-expression before '=' token
    7 |     if(c!==0){break;}
      |           ^
Language: C++

string s, t;
	cin >> s >> t;
	string f = "Yes";
	int size = s.size();

	vector<char> a(size);
	vector<char> b(size);
	vector<char> c(size);

	for (int i = 0; i < size; i++) {
		a[i] = s[i];
		b[i] = t[i];
		c[i] = s[i];
	}
	for (int i = 0; i < size; i++) {
		char p, q;
		p = a[i];
		q = b[i];
		for (int j = 0; j < size; j++) {
			if (a[j] == p) {
				a[j] = q;
			}
			else if (a[j] == q) {
				a[j] = p;
			}
		}
	}
	
	for (int i = 0; i < s.size(); i++) {
		if (a[i] != b[i])f = "No";
		
	}
	cout << f << endl;
	return 0;

}

Compiler output:
a.cc:1:1: error: 'string' does not name a type
    1 | string s, t;
      | ^~~~~~
a.cc:2:9: error: 'cin' does not name a type
    2 |         cin >> s >> t;
      |         ^~~
a.cc:3:9: error: 'string' does not name a type
    3 |         string f = "Yes";
      |         ^~~~~~
a.cc:4:20: error: 's' was not declared in this scope
    4 |         int size = s.size();
      |                    ^
a.cc:6:9: error: 'vector' does not name a type
    6 |         vector<char> a(size);
      |         ^~~~~~
a.cc:7:9: error: 'vector' does not name a type
    7 |         vector<char> b(size);
      |         ^~~~~~
a.cc:8:9: error: 'vector' does not name a type
    8 |         vector<char> c(size);
      |         ^~~~~~
a.cc:10:9: error: expected unqualified-id before 'for'
   10 |         for (int i = 0; i < size; i++) {
      |         ^~~
a.cc:10:25: error: 'i' does not name a type
   10 |         for (int i = 0; i < size; i++) {
      |                         ^
a.cc:10:35: error: 'i' does not name a type
   10 |         for (int i = 0; i < size; i++) {
      |                                   ^
a.cc:15:9: error: expected unqualified-id before 'for'
   15 |         for (int i = 0; i < size; i++) {
      |         ^~~
a.cc:15:25: error: 'i' does not name a type
   15 |         for (int i = 0; i < size; i++) {
      |                         ^
a.cc:15:35: error: 'i' does not name a type
   15 |         for (int i = 0; i < size; i++) {
      |                                   ^
a.cc:29:9: error: expected unqualified-id before 'for'
   29 |         for (int i = 0; i < s.size(); i++) {
      |         ^~~
a.cc:29:25: error: 'i' does not name a type
   29 |         for (int i = 0; i < s.size(); i++) {
      |                         ^
a.cc:29:39: error: 'i' does not name a type
   29 |         for (int i = 0; i < s.size(); i++) {
      |                                       ^
a.cc:33:9: error: 'cout' does not name a type
   33 |         cout << f << endl;
      |         ^~~~
a.cc:34:9: error: expected unqualified-id before 'return'
   34 |         return 0;
      |         ^~~~~~
a.cc:36:1: error: expected declaration before '}' token
   36 | }
      | ^
Language: Java

import java.util.*;
public class Main {
   static Scanner sc = new Scanner(System.in);
   static Scanner sc2 = new Scanner(System.in);
   public static void main(String[] args) {
      char[] S = toCharArray(sc.next());
      char[] T = toCharArray(sc.next());
      String msg = "Yes";

      if (S.equals(T)) {
         System.out.println("No");
         return;
      }
      for (int i = 0; i < S.length; i++ ) {

         if (S[i] != T[i]) {
            String str = String.valueOf(T);
            int num = str.indexOf(S[i]);
            if (num != -1 && (S[num] != T[num] || S[num] != T[i])) {
               msg = "No";
               break;
            }
         }
      }

      System.out.println(msg);
   }
}

Compiler output:
Main.java:6: error: cannot find symbol
      char[] S = toCharArray(sc.next());
                 ^
  symbol:   method toCharArray(String)
  location: class Main
Main.java:7: error: cannot find symbol
      char[] T = toCharArray(sc.next());
                 ^
  symbol:   method toCharArray(String)
  location: class Main
2 errors