結果
| 問題 | No.69 文字を自由に並び替え |
| コンテスト | |
| ユーザー |
marinebox
|
| 提出日時 | 2020-11-22 23:22:19 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 508 bytes |
| 記録 | |
| コンパイル時間 | 1,649 ms |
| コンパイル使用メモリ | 189,920 KB |
| 実行使用メモリ | 7,972 KB |
| 最終ジャッジ日時 | 2026-04-03 15:15:42 |
| 合計ジャッジ時間 | 3,009 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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