結果
| 問題 | No.69 文字を自由に並び替え | 
| コンテスト | |
| ユーザー |  seriru13 | 
| 提出日時 | 2019-04-30 10:46:10 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 5,000 ms | 
| コード長 | 1,220 bytes | 
| コンパイル時間 | 1,144 ms | 
| コンパイル使用メモリ | 113,196 KB | 
| 最終ジャッジ日時 | 2025-01-07 03:17:07 | 
| ジャッジサーバーID (参考情報) | judge3 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 15 | 
ソースコード
/*
 * No.69 文字を自由に並び替え
 */ 
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <functional>
#include <queue>
#include <string>
#include <cstring>
#include <numeric>
#include <cstdlib>
#include <cmath>
#include <map>
using namespace std;
typedef long long ll;
#define INF 10e17 // 4倍しても(4回足しても)long longを溢れない
#define rep(i,n) for(int i=0; i<n; i++)
#define rep_r(i,n,m) for(int i=m; i<n; i++)
#define END cout << endl
#define MOD 1000000007
#define pb push_back
#define sorti(x) sort(x.begin(), x.end())
#define sortd(x) sort(x.begin(), x.end(), std::greater<int>())
#define debug(x) std::cerr << (x) << std::endl;
#define roll(x) for (auto itr : x) { debug(itr); }
template <class T> inline void chmax(T &ans, T t) { if (t > ans) ans = t;}
template <class T> inline void chmin(T &ans, T t) { if (t < ans) ans = t;}
int main() {
  string s, t;
  cin >> s >> t;
  
  map<char,ll> mp1, mp2;
  for (int i = 0; i < s.size(); ++i) {
    mp1[s[i]] += 1;
    mp2[t[i]] += 1;
  }
  for (auto itr : mp1) {
    if (mp2[itr.first] != itr.second) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  return 0;
}
            
            
            
        