結果

問題 No.224 文字列変更(easy)
ユーザー kmtrc130kmtrc130
提出日時 2019-03-18 15:39:22
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 63 ms / 5,000 ms
コード長 642 bytes
コンパイル時間 2,218 ms
コンパイル使用メモリ 103,892 KB
実行使用メモリ 23,692 KB
最終ジャッジ日時 2023-09-25 02:45:58
合計ジャッジ時間 4,550 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
21,608 KB
testcase_01 AC 62 ms
23,588 KB
testcase_02 AC 59 ms
23,692 KB
testcase_03 AC 63 ms
23,552 KB
testcase_04 AC 58 ms
21,736 KB
testcase_05 AC 58 ms
23,592 KB
testcase_06 AC 59 ms
21,692 KB
testcase_07 AC 58 ms
21,720 KB
testcase_08 AC 59 ms
21,592 KB
testcase_09 AC 58 ms
21,704 KB
testcase_10 AC 58 ms
21,540 KB
testcase_11 AC 59 ms
21,776 KB
testcase_12 AC 58 ms
19,540 KB
testcase_13 AC 60 ms
21,652 KB
testcase_14 AC 58 ms
19,476 KB
testcase_15 AC 61 ms
21,716 KB
testcase_16 AC 63 ms
21,548 KB
testcase_17 AC 61 ms
23,532 KB
testcase_18 AC 62 ms
21,664 KB
testcase_19 AC 61 ms
23,656 KB
testcase_20 AC 62 ms
21,600 KB
testcase_21 AC 62 ms
23,548 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;

class Program
{
    public void Solve()
    {
        int n = int.Parse(Console.ReadLine());
        char[] S = Console.ReadLine().ToArray();
        char[] T = Console.ReadLine().ToArray();

        int idx = 0;
        int ans = 0;
        while (new string(S) != new string(T))
        {
            if (S[idx] != T[idx])
            {
                S[idx] = T[idx];
                ans++;
            }
            idx++;
        }
        Console.WriteLine(ans);
    }

    static void Main()
    {
        var solver = new Program();
        solver.Solve();
    }
}
0