Language: C++

#include <iostream>
#include <vector>
#include <string>
int main(){

  string S,T; cin >> S >> T;
  vector<int> start(26,-1);
  vector<int> goal(26,-1);

  for(int i = 0;i < S.size();i++){
    int a = S[i] - 'a';//a->b
    int b = T[i] - 'a';//b->a

    if(start[a] != -1 || goal[b] != -1){
      if(start[a] != b || goal[b] != a){
        cout << "No" << endl;
        return 0;
      }
    }
    else{
      start[a] = b;
      goal[b] = a;//置換と逆置換の対応を付ける.
    }
  }


  cout << "Yes" < endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'string' was not declared in this scope
    6 |   string S,T; cin >> S >> T;
      |   ^~~~~~
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:6:15: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   string S,T; cin >> S >> T;
      |               ^~~
      |               std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:6:22: error: 'S' was not declared in this scope
    6 |   string S,T; cin >> S >> T;
      |                      ^
a.cc:6:27: error: 'T' was not declared in this scope
    6 |   string S,T; cin >> S >> T;
      |                           ^
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<int> start(26,-1);
      |   ^~~~~~
a.cc:7:3: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vector<int> start(26,-1);
      |          ^~~
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vector<int> goal(26,-1);
      |          ^~~
a.cc:14:8: error: 'start' was not declared in this scope
   14 |     if(start[a] != -1 || goal[b] != -1){
      |        ^~~~~
a.cc:14:26: error: 'goal' was not declared in this scope
   14 |     if(start[a] != -1 || goal[b] != -1){
      |                          ^~~~
a.cc:16:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   16 |         cout << "No" << 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:16:25: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   16 |         cout << "No" << endl;
      |                         ^~~~
      |                         std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:27:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   27 |   cout << "Yes" < 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:27:19: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   27 |   cout << "Yes" < endl;
      |                   ^~~~
      |                   std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~