結果

問題 No.69 文字を自由に並び替え
ユーザー mell1mell1
提出日時 2018-11-22 20:48:50
言語 C++11
(gcc 11.4.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 631 bytes
コンパイル時間 412 ms
コンパイル使用メモリ 52,604 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-21 00:10:34
合計ジャッジ時間 1,164 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 WA -
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 1 ms
4,376 KB
testcase_14 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0