結果

問題 No.224 文字列変更(easy)
ユーザー CroweaCrowea
提出日時 2019-01-25 00:00:00
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 56 ms / 5,000 ms
コード長 636 bytes
コンパイル時間 1,079 ms
コンパイル使用メモリ 65,360 KB
実行使用メモリ 20,792 KB
最終ジャッジ日時 2023-09-25 02:43:52
合計ジャッジ時間 3,333 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 55 ms
20,584 KB
testcase_01 AC 55 ms
18,628 KB
testcase_02 AC 54 ms
20,556 KB
testcase_03 AC 56 ms
20,676 KB
testcase_04 AC 55 ms
20,484 KB
testcase_05 AC 56 ms
20,728 KB
testcase_06 AC 55 ms
20,636 KB
testcase_07 AC 53 ms
20,544 KB
testcase_08 AC 56 ms
20,712 KB
testcase_09 AC 55 ms
20,680 KB
testcase_10 AC 54 ms
20,724 KB
testcase_11 AC 56 ms
20,700 KB
testcase_12 AC 55 ms
20,608 KB
testcase_13 AC 55 ms
20,676 KB
testcase_14 AC 55 ms
20,632 KB
testcase_15 AC 55 ms
20,672 KB
testcase_16 AC 56 ms
20,712 KB
testcase_17 AC 55 ms
20,544 KB
testcase_18 AC 56 ms
20,792 KB
testcase_19 AC 56 ms
20,740 KB
testcase_20 AC 55 ms
20,576 KB
testcase_21 AC 55 ms
20,680 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using System;

class Program
{
    static void Main(string[] args)
    {
        // 入力
        var N = int.Parse(Console.ReadLine());
        var S = Console.ReadLine().ToCharArray();
        var T = Console.ReadLine().ToCharArray();

        // S = T でプログラム終了.
        if (S == T)
        {
            Console.WriteLine(0);
            return;
        }

        int repCount = 0; // 交換回数
        for (int i = 0; i < N; i++)
        {
            if (S[i] != T[i])
            {
                S[i] = T[i];
                repCount++;
            }
        }
        Console.WriteLine(repCount);
    }
}

0