結果
問題 | No.69 文字を自由に並び替え |
ユーザー |
![]() |
提出日時 | 2017-09-26 21:53:09 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 656 bytes |
コンパイル時間 | 609 ms |
コンパイル使用メモリ | 78,872 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-14 06:45:59 |
合計ジャッジ時間 | 1,236 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 15 |
ソースコード
#include <iostream> #include <vector> #include <string> #include <cstring> #include <math.h> #include <cmath> #include <limits.h> #include <map> #include <set> #include <queue> #include <algorithm> #include <functional> #include <stdio.h> using namespace std; long long MOD = 1000000007; int main() { int a[26] = {0}; int b[26] = {0}; string A, B; cin >> A >> B; for ( int i = 0; i < A.length(); i++ ) { a[ A[i] - 'a' ]++; b[ B[i] - 'a' ]++; } for ( int i = 0; i < 26; i++ ) { if ( a[i] != b[i] ) { cout << "NO" << endl; return 0; } } cout << "YES" << endl; return 0; }