简单题,看起来很凶
#include <iostream> #include <stdio.h> #include <string> #include <stack> #include <map> #include <vector> #include <algorithm> using namespace std; int main() { vector<); vector<); string first, second; cin >> first >> second; ; i < first.size(); ++i) { S[first[i]-'A']++; T[second[i]-'A']++; } bool same = true; sort(S.begin(), S.end()); sort(T.begin(), T.end()); ; i < ; ++i) { if (S[i] != T[i]) { same = false; break; } } if (same) cout << "YES" << endl; else cout << "NO" << endl; ; }