結果
問題 | No.69 文字を自由に並び替え |
ユーザー |
![]() |
提出日時 | 2015-05-27 00:16:49 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 544 bytes |
コンパイル時間 | 557 ms |
コンパイル使用メモリ | 64,936 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-14 05:56:09 |
合計ジャッジ時間 | 1,221 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 15 |
ソースコード
#include <iostream> #include <algorithm> #include <functional> #include <string> #include <limits.h> #include <vector> #include <numeric> using namespace std; int main(){ int count1[26] = {0}; int count2[26] = {0}; int flg = true; string s1,s2; cin >> s1 >> s2; for(int i=0; i<s1.length(); i++){ count1[ s1[i] - 'a' ] ++; count2[ s2[i] - 'a' ] ++; } flg = true; for(int i=0; i<26; i++){ if(count1[i] != count2[i]){ flg = false; } } if(flg){ cout << "YES" << endl; }else{ cout << "NO" << endl; } return 0; }