Language: C++

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

int main() {
  string s, t;
  cin >> s >> t;
  v2c v(26);
  unoredered_set<char> a, b;
  vector<pair<char, char>> e;
  bool c = 1;
  rep(i, s.size()){
    bool d = 1;
    rep(j, v[s[i]-'a'].size()){
      if(v[s[i]-'a'][j] == t[i]){
        d = 0;
        break;
      }
    }
    if(d) v[s[i]-'a'].push_back(t[i]);
  }
  rep(i, 26){
    if(v[i].size() > 1){
      b = 0;
      break;
    }
  }
  if(b){
    rep(i, 26) if(v[i].size() > 0) e.push_back(v[i][0], (char)('a'+i));
    sort(e.begin(), e.end());
    int f = 1;
    rep(i, e.size()){
      if(i < e.size()-1 && e[i].fi == e[i+1].fi) ++f;
      else f = 1;
      if(a.count(e[i].fi)) --f;
      if(f > 1){
        b = 0;
        break;
      }
    }
  }
  if(b) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:3: error: 'unoredered_set' was not declared in this scope
   33 |   unoredered_set<char> a, b;
      |   ^~~~~~~~~~~~~~
a.cc:33:18: error: expected primary-expression before 'char'
   33 |   unoredered_set<char> a, b;
      |                  ^~~~
a.cc:48:7: error: 'b' was not declared in this scope
   48 |       b = 0;
      |       ^
a.cc:52:6: error: 'b' was not declared in this scope
   52 |   if(b){
      |      ^
a.cc:53:47: error: no matching function for call to 'std::vector<std::pair<char, char> >::push_back(__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&, char)'
   53 |     rep(i, 26) if(v[i].size() > 0) e.push_back(v[i][0], (char)('a'+i));
      |                                    ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<char, char>; _Alloc = std::allocator<std::pair<char, char> >; value_type = std::pair<char, char>]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::pair<char, char>; _Alloc = std::allocator<std::pair<char, char> >; value_type = std::pair<char, char>]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note:   candidate expects 1 argument, 2 provided
a.cc:59:10: error: 'a' was not declared in this scope
   59 |       if(a.count(e[i].fi)) --f;
      |          ^
a.cc:66:6: error: 'b' was not declared in this scope
   66 |   if(b) cout << "Yes" << endl;
      |      ^