結果

問題 No.69 文字を自由に並び替え
コンテスト
ユーザー focus
提出日時 2018-01-29 22:12:54
言語 C++11
(gcc 15.3.0 + boost 1.92.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 5,000 ms
+ 352µs
コード長 498 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 334 ms
コンパイル使用メモリ 88,840 KB
実行使用メモリ 9,864 KB
最終ジャッジ日時 2026-10-03 07:39:32
合計ジャッジ時間 1,453 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include<iostream>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<cmath>
using namespace std;
int main(){
    int table1[26]={0},table2[26]={0};
    string s1,s2;
    cin >> s1 >> s2;
    for(int i=0;s1[i]!='\0';i++){
        table1[s1[i]-'a']++;
    }
    for(int i=0;s2[i]!='\0';i++){
        table2[s2[i]-'a']++;
    }
    for(int i=0;i<26;i++){
        if(table1[i]!=table2[i]){
            cout << "NO";
            return 0;
        }
    }
    cout << "YES";
    return 0;
}
0