Advertisement
AquaBlitz11

TASK_067 - AquaBlitz11's Solution

Mar 5th, 2018
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. const int N = 1010;
  5.  
  6. char s[N], t[N];
  7. int cnt[26], cnt2[26];
  8.  
  9. int main()
  10. {
  11.     scanf("%s %s", s, t);
  12.     for (int i = 0; s[i]; ++i)
  13.         ++cnt[s[i]-'A'];
  14.     for (int i = 0; t[i]; ++i)
  15.         ++cnt2[t[i]-'A'];
  16.     bool fail = false;
  17.     for (int i = 0; i < 26; ++i) {
  18.         if (cnt[i] != cnt2[i])
  19.             fail = true;
  20.     }
  21.     if (fail) printf("No\n");
  22.     else printf("Yes\n");
  23.    
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement