結果
問題 | No.69 文字を自由に並び替え |
ユーザー |
![]() |
提出日時 | 2020-03-09 04:42:08 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 374 bytes |
コンパイル時間 | 1,864 ms |
コンパイル使用メモリ | 168,448 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-07 20:41:50 |
合計ジャッジ時間 | 2,691 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 15 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); string S, T; cin >> S >> T; vector<int> cnts(26, 0), cntt(26, 0); for (char s : S) { cnts[s - 'a']++; } for (char t : T) { cntt[t - 'a']++; } if (cnts == cntt) { cout << "YES" << '\n'; } else { cout << "NO" << '\n'; } return 0; }