結果

問題 No.69 文字を自由に並び替え
ユーザー mizni
提出日時 2020-05-03 17:57:58
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 373 bytes
コンパイル時間 2,218 ms
コンパイル使用メモリ 192,360 KB
最終ジャッジ日時 2025-01-10 06:17:04
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
  string s_1, s_2;

  cin >> s_1 >> s_2;
  for (int i = 0; i < (int)s_1.size(); i++) {
    for (int j = 0; j < (int)s_2.size(); j++) {
      if (s_1[i] == s_2[j]) {
        s_2.erase(j, 1);
        break;
      }
    }
  }
  if (s_2.empty()) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}
0