結果

問題 No.69 文字を自由に並び替え
ユーザー bayashiko_rbayashiko_r
提出日時 2018-11-03 18:01:24
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 52 ms / 5,000 ms
コード長 667 bytes
コンパイル時間 2,028 ms
コンパイル使用メモリ 100,212 KB
実行使用メモリ 22,520 KB
最終ジャッジ日時 2023-08-21 00:10:08
合計ジャッジ時間 3,638 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 49 ms
22,520 KB
testcase_01 AC 49 ms
20,452 KB
testcase_02 AC 50 ms
20,540 KB
testcase_03 AC 51 ms
20,520 KB
testcase_04 AC 50 ms
20,484 KB
testcase_05 AC 50 ms
18,552 KB
testcase_06 AC 50 ms
20,628 KB
testcase_07 AC 50 ms
20,448 KB
testcase_08 AC 52 ms
20,544 KB
testcase_09 AC 51 ms
22,444 KB
testcase_10 AC 51 ms
20,544 KB
testcase_11 AC 51 ms
20,564 KB
testcase_12 AC 51 ms
20,564 KB
testcase_13 AC 51 ms
22,500 KB
testcase_14 AC 51 ms
20,544 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

class Program {
    static void Main(string[] args) {
        //入力
        string A = Console.ReadLine();
        string B = Console.ReadLine();

        //文字列から各文字を取得
        char[] arrayA = A.ToCharArray();
        char[] arrayB = B.ToCharArray();

        //それぞれを並び替える
        Array.Sort<char>(arrayA);
        Array.Sort<char>(arrayB);

        //合っているかチェックする
        for (int i = 0; i < A.Length; i++) {
            if (arrayA[i] != arrayB[i]) {
                Console.WriteLine("NO");
                return;
            }
        }
        Console.WriteLine("YES");
    }
}
0