結果
問題 | No.69 文字を自由に並び替え |
ユーザー |
|
提出日時 | 2017-08-21 01:41:08 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 477 bytes |
コンパイル時間 | 477 ms |
コンパイル使用メモリ | 61,352 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-14 06:43:51 |
合計ジャッジ時間 | 1,106 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 15 |
ソースコード
#include <iostream>#include <vector>#include <string>#include <algorithm>#include <numeric>#define N 26using namespace std;typedef long long int lint;int main(){int Achar[N] = { 0 }, Bchar[N] = { 0 };string A, B;cin >> A >> B;for (int i = 0; i < A.size(); i++) {Achar[A[i] - 'a']++;Bchar[B[i] - 'a']++;}for (int i = 0; i < N; i++) {if (Achar[i] != Bchar[i]) {cout << "NO" << endl;return 0;}}cout << "YES" << endl;return 0;}