結果

問題 No.69 文字を自由に並び替え
ユーザー soy
提出日時 2019-07-28 19:31:10
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 337 bytes
コンパイル時間 990 ms
コンパイル使用メモリ 58,972 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-02 15:06:13
合計ジャッジ時間 1,498 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>

using namespace std;

int main() {
	char a[15], b[15],i;
	int ans=0;
	for (i = 0; i < 15; i++) {
		a[i] = b[i] = 0;
	}

	cin >> a >> b;
	sort(a,a+10);
	sort(b, b + 10);
	for (i = 0; i < 10; i++) {
		if (a[i] != b[i]) 
			ans=1;
	}
	if (ans)
		cout << "NO\n";
	else
	cout << "YES\n";
	return 0;
}
0