結果
問題 | No.69 文字を自由に並び替え |
ユーザー |
![]() |
提出日時 | 2017-03-01 23:22:53 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 481 bytes |
コンパイル時間 | 650 ms |
コンパイル使用メモリ | 60,372 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-12-14 06:30:35 |
合計ジャッジ時間 | 1,517 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 15 |
ソースコード
#include <iostream> #include <vector> #include <algorithm> #include <string> #define REP(i,n) for(int i=0;i<(n);++i) #define SORT(a) sort((a).begin(),(a).end()) #define PB push_back using namespace std; typedef vector<int> VI; int main(){ string A, B; cin >> A >> B; int c[26] = {}, d[26] = {}; int l = A.size(); REP(i,l){ c[A[i] - 'a']++; d[B[i] - 'a']++; } int r = 1; REP(i,26){ if(c[i] != d[i]){ r = 0; } } cout << (r ? "YES" : "NO") << endl; }