結果

問題 No.69 文字を自由に並び替え
ユーザー kuchiha0343
提出日時 2014-11-18 23:36:25
言語 C++11
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 813 bytes
コンパイル時間 861 ms
コンパイル使用メモリ 69,348 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-14 05:09:44
合計ジャッジ時間 1,812 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <numeric>
#include <climits>
#include <cstdlib>
#include <functional>
#include <iostream>
#include <queue>
#include <vector>
#include <algorithm> 
#include <map>


#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define dump(a) (cerr << #a << "=" << (a) << endl)
#define DUMP(list) cout << "{"; for(auto nth : list){ cout << nth << " ";}cout << "}" << endl;

using namespace std;

int strCount[26]={0};

int main() {

	string str1,str2;
		
	cin >> str1 >> str2;

	rep(i,str1.length()){
		strCount[(str1[i] - 'a')]++;	
		strCount[(str2[i] - 'a')]--;
	}

	rep(i,26){
		if(strCount[i]!=0){
			cout << "NO" << endl;
			return 0;
		}
	}

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