結果
| 問題 |
No.69 文字を自由に並び替え
|
| コンテスト | |
| ユーザー |
sntea
|
| 提出日時 | 2015-08-26 14:54:42 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 783 bytes |
| コンパイル時間 | 660 ms |
| コンパイル使用メモリ | 74,156 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-12-14 06:02:57 |
| 合計ジャッジ時間 | 1,282 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 15 |
ソースコード
#include <iostream>
#include <cmath>
#include <climits>
#include <string>
#include <vector>
#include <functional>
#include <algorithm>
#include <sstream>
#include <map>
#include <set>
#include <utility>
#define endl '\n'
#define ALL(a) (a).begin(),(a).end()
#define SZ(a) int((a).size())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
using namespace std;
typedef pair<int,int> P;
typedef long long int LL;
int counta[26];
int countb[26];
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
string A,B;
cin>>A;
cin>>B;
REP(i,SZ(A)){
counta[A[i]-'a']++;
}
REP(i,SZ(B)){
countb[B[i]-'a']++;
}
string ans="YES";
REP(i,26){
//cout<<counta[i]<<' '<<countb[i]<<endl;
if(counta[i]!=countb[i]) ans="NO";
}
cout<<ans<<endl;
return 0;
}
sntea