結果
| 問題 |
No.69 文字を自由に並び替え
|
| コンテスト | |
| ユーザー |
marinebox
|
| 提出日時 | 2020-11-22 23:22:19 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 508 bytes |
| コンパイル時間 | 1,813 ms |
| コンパイル使用メモリ | 176,680 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-23 16:47:54 |
| 合計ジャッジ時間 | 2,326 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 15 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(){
string a, b;
cin >> a >> b;
map<int, int> alphabetA, alphabetB;
for(auto c : a){
int tmp = c - 'a';
alphabetA[tmp]++;
}
for(auto c : b){
int tmp = c - 'a';
alphabetB[tmp]++;
}
const string yes = "YES";
const string no = "NO";
string ans = yes;
for(int i = 0; i < 26; i++){
if(alphabetA[i] != alphabetB[i]) ans = no;
}
cout << ans << endl;
return 0;
}
marinebox