結果
問題 | No.69 文字を自由に並び替え |
ユーザー |
|
提出日時 | 2017-07-16 11:35:01 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 436 bytes |
コンパイル時間 | 441 ms |
コンパイル使用メモリ | 57,792 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-14 06:41:55 |
合計ジャッジ時間 | 1,101 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 15 |
ソースコード
#include <iostream>#include <string>#include <algorithm>using namespace std;int main(){string a, b;cin >> a >> b;int ac[26] = {}, bc[26] = {};for(int i=0; i<a.length(); i++){ac[a[i] - 'a']++;bc[b[i] - 'a']++;}for(int i=0; i<26; i++){if(ac[i] != bc[i]) {cout << "NO" << endl;return 0;}}cout << "YES" << endl;return 0;}