結果

問題 No.69 文字を自由に並び替え
コンテスト
ユーザー ただのガゼス(MonAgent)
提出日時 2023-12-27 01:54:40
言語 C++14
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 5,000 ms
+ 401µs
コード長 570 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 996 ms
コンパイル使用メモリ 188,300 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2026-09-05 07:08:34
合計ジャッジ時間 2,253 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;

int main()
{
    string A, B;
    map<char,int> Amap;
    map<char,int> Bmap;
    cin >> A >> B;

    for (int i = 0; i < A.size(); ++i){
        char c;
        Amap[c] = 0; 
        Bmap[c] = 0; 
    }
    
    for (int i = 0; i < A.size(); ++i){
        char c = A[i];
        Amap[c] += 1; 
    }


    for (int i = 0; i < A.size(); ++i){
        char c = B[i];
        Bmap[c] += 1; 
    }

    if (Amap == Bmap){
        cout << "YES" << endl;
    }else{
        cout << "NO" << endl;        
    }

    return 0;
}

0