Language: C++

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

  map<char, vector<int> > S_chraIndexs = SerchChractorIndex(S);
  map<char, vector<int> > T_chraIndexs = SerchChractorIndex(T);

  bool flag = false;
  for (map<char, vector<int> >::iterator itr_S = S_chraIndexs.begin(); itr_S != S_chraIndexs.end(); ++itr_S)
  {
    for (map<char, vector<int> >::iterator itr_T = T_chraIndexs.begin(); itr_T != T_chraIndexs.end(); ++itr_T)
    {
      if (itr_S->second == itr_T->second) 
      {
        flag = true;
        break;
      }
    }

    if(flag == false)
    {
      cout << "NO" << endl;
      return;
    }
    else flag = false;

  }
  cout << "YES" << endl;
  return ;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:3: error: 'string' was not declared in this scope
    3 |   string S, T;
      |   ^~~~~~
a.cc:4:3: error: 'cin' was not declared in this scope
    4 |   cin >> S >> T;
      |   ^~~
a.cc:4:10: error: 'S' was not declared in this scope
    4 |   cin >> S >> T;
      |          ^
a.cc:4:15: error: 'T' was not declared in this scope
    4 |   cin >> S >> T;
      |               ^
a.cc:6:3: error: 'map' was not declared in this scope
    6 |   map<char, vector<int> > S_chraIndexs = SerchChractorIndex(S);
      |   ^~~
a.cc:6:7: error: expected primary-expression before 'char'
    6 |   map<char, vector<int> > S_chraIndexs = SerchChractorIndex(S);
      |       ^~~~
a.cc:7:7: error: expected primary-expression before 'char'
    7 |   map<char, vector<int> > T_chraIndexs = SerchChractorIndex(T);
      |       ^~~~
a.cc:10:12: error: expected primary-expression before 'char'
   10 |   for (map<char, vector<int> >::iterator itr_S = S_chraIndexs.begin(); itr_S != S_chraIndexs.end(); ++itr_S)
      |            ^~~~
a.cc:10:72: error: 'itr_S' was not declared in this scope
   10 |   for (map<char, vector<int> >::iterator itr_S = S_chraIndexs.begin(); itr_S != S_chraIndexs.end(); ++itr_S)
      |                                                                        ^~~~~
a.cc:10:81: error: 'S_chraIndexs' was not declared in this scope
   10 |   for (map<char, vector<int> >::iterator itr_S = S_chraIndexs.begin(); itr_S != S_chraIndexs.end(); ++itr_S)
      |                                                                                 ^~~~~~~~~~~~
a.cc:12:14: error: expected primary-expression before 'char'
   12 |     for (map<char, vector<int> >::iterator itr_T = T_chraIndexs.begin(); itr_T != T_chraIndexs.end(); ++itr_T)
      |              ^~~~
a.cc:12:74: error: 'itr_T' was not declared in this scope
   12 |     for (map<char, vector<int> >::iterator itr_T = T_chraIndexs.begin(); itr_T != T_chraIndexs.end(); ++itr_T)
      |                                                                          ^~~~~
a.cc:12:83: error: 'T_chraIndexs' was not declared in this scope
   12 |     for (map<char, vector<int> >::iterator itr_T = T_chraIndexs.begin(); itr_T != T_chraIndexs.end(); ++itr_T)
      |                                                                                   ^~~~~~~~~~~~
a.cc:23:7: error: 'cout' was not declared in this scope
   23 |       cout << "NO" << endl;
      |       ^~~~
a.cc:23:23: error: 'endl' was not declared in this scope
   23 |       cout << "NO" << endl;
      |                       ^~~~
a.cc:24:7: error: return-statement with no value, in function returning 'int' [-fpermissive]
   24 |       return;
      |       ^~~~~~
a.cc:29:3: error: 'cout' was not declared in this scope
   29 |   cout << "YES" << endl;
      |   ^~~~
a.cc:29:20: error: 'endl' was not declared in this scope
   29 |   cout << "YES" << endl;
      |                    ^~~~
a.cc:30:3: error: return-statement with no value, in function returning 'int' [-fpermissive]
   30 |   return ;
      |   ^~~~~~