結果

問題 No.69 文字を自由に並び替え
ユーザー mell1mell1
提出日時 2018-11-22 20:39:57
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 561 bytes
コンパイル時間 363 ms
コンパイル使用メモリ 51,980 KB
実行使用メモリ 4,500 KB
最終ジャッジ日時 2023-08-26 04:00:39
合計ジャッジ時間 1,370 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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() {
    char a[10] = {'0'};
    char b[10] = {'0'};
    cin >> a >> b;
    sort(10, a);
    sort(10, b);
    if (!strcmp(a, b)) {
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }
    return 0;
}
0