結果

問題 No.69 文字を自由に並び替え
ユーザー non
提出日時 2019-03-06 23:56:56
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 464 bytes
コンパイル時間 1,715 ms
コンパイル使用メモリ 172,696 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-14 07:22:24
合計ジャッジ時間 2,205 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main()
{
  string str1, str2;
  cin >> str1 >> str2;

  vector<char> v1;
  vector<char> v2;

  for (int i = 0; i < str1.length(); ++i)
  {
    v1.push_back(str1[i]);
    v2.push_back(str2[i]);
  }

  sort(v1.begin(), v1.end());
  sort(v2.begin(), v2.end());

  for (int i = 0; i < v1.size(); ++i)
  {
    if (v1[i] != v2[i])
    {
      cout << "NO" << endl;
      exit(0);
    }
  }

  cout << "YES" << endl;
}
0