結果

問題 No.69 文字を自由に並び替え
ユーザー test
提出日時 2017-06-10 09:35:18
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
RE  
実行時間 -
コード長 472 bytes
コンパイル時間 409 ms
コンパイル使用メモリ 56,268 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-27 13:46:57
合計ジャッジ時間 1,017 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 9 RE * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <cctype>
#include <typeinfo>
#include <cstdlib>

using namespace std;

int main() {
  string strA, strB;

  cin >> strA >> strB;

  int num[26];

  for(int i=0;i<strA.size();i++){
    num[(int)(strA[i] - 'a')]++;
  }
  for(int i=0;i<strB.size();i++){
    num[(int)(strB[i] - 'a')]--;
  }
  for(int i=0;i<26;i++){
    if(num[i]!=0){
      cout << "NO" << endl;
      return 1;
    }
  }
  cout << "YES" << endl;
  return 0;
}
0