結果
問題 | No.69 文字を自由に並び替え |
ユーザー |
|
提出日時 | 2017-06-29 14:07:11 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 381 bytes |
コンパイル時間 | 482 ms |
コンパイル使用メモリ | 60,120 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-14 06:41:20 |
合計ジャッジ時間 | 1,110 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 15 |
ソースコード
#include <iostream>#include <vector>using namespace std;const int AL_N = 'z' - 'a' + 1;int main() {string a, b;cin >> a >> b;vector<int> a_num(AL_N, 0), b_num(AL_N, 0);for (char c : a) a_num[c - 'a'] += 1;for (char c : b) b_num[c - 'a'] += 1;if (a_num == b_num) {cout << "YES" << endl;} else {cout << "NO" << endl;}}