結果

問題 No.69 文字を自由に並び替え
ユーザー focus
提出日時 2018-01-29 22:12:54
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 498 bytes
コンパイル時間 540 ms
コンパイル使用メモリ 64,736 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-14 06:55:02
合計ジャッジ時間 1,172 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

#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