結果

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

ソースコード

diff #

#include <iostream>
#include <vector>
using namespace std;

int main() {
    vector<int> v1(26), v2(26);
    string s1, s2;
    cin >> s1 >> s2;
    for(int i=0; i<s1.size(); ++i) {
        v1[s1[i]-'a']++;
        v2[s2[i]-'a']++;
    }
    if(v1 == v2) {
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }
}
0