結果
| 問題 | No.69 文字を自由に並び替え |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-11-22 20:48:50 |
| 言語 | C++11 (gcc 15.3.0 + boost 1.92.0) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 5,000 ms |
| + 362µs | |
| コード長 | 631 bytes |
| 記録 | |
| コンパイル時間 | 262 ms |
| コンパイル使用メモリ | 74,256 KB |
| 実行使用メモリ | 9,864 KB |
| 最終ジャッジ日時 | 2026-10-03 07:53:52 |
| 合計ジャッジ時間 | 1,496 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 15 |
ソースコード
#include <iostream>
#include <string.h>
using namespace std;
void sort(int n, char a[]) {
int i, j;
char tmp;
for (i=0; i<=n-2; i++) {
for (j=i+1; j<n; j++) {
if (a[i] > a[j]) {
tmp = a[i];
a[i] = a[j];
a[j] = tmp;
}
}
}
}
int main() {
int i;
char a[10];
char b[10];
cin >> a >> b;
for (i=0; i<10; i++) {
if (a[i] < 97 || a[i] > 122) break;
}
sort(i, a);
sort(i, b);
if (!strcmp(a, b)) {
cout << "YES" << endl;
} else {
cout << "NO" << endl;
}
return 0;
}