結果
| 問題 |
No.69 文字を自由に並び替え
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-12-05 16:41:07 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 564 bytes |
| コンパイル時間 | 572 ms |
| コンパイル使用メモリ | 56,772 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-12-14 06:52:04 |
| 合計ジャッジ時間 | 1,234 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 15 |
ソースコード
#include <iostream>
#include <string>
int main() {
std::string A, B;
int check[10] = { 0 };
int match = 0;
std::cin >> A >> B;
int N = A.size();
for (int i=0; i<N; i++) {
for (int j=0; j<N; j++) {
if (check[j]==1) continue;
if (A[i] == B[j]) {
check[j] = 1;
match += 1;
break;
}
}
}
if (match == N)
std::cout << "YES" << std::endl;
else
std::cout << "NO" << std::endl;
return 0;
}