結果

問題 No.224 文字列変更(easy)
ユーザー kmtrc130kmtrc130
提出日時 2017-05-18 09:08:50
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 63 ms / 5,000 ms
コード長 524 bytes
コンパイル時間 2,499 ms
コンパイル使用メモリ 104,032 KB
実行使用メモリ 25,812 KB
最終ジャッジ日時 2023-09-25 02:23:41
合計ジャッジ時間 4,496 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
21,556 KB
testcase_01 AC 63 ms
25,812 KB
testcase_02 AC 59 ms
21,624 KB
testcase_03 AC 59 ms
21,636 KB
testcase_04 AC 58 ms
19,652 KB
testcase_05 AC 58 ms
21,536 KB
testcase_06 AC 59 ms
21,680 KB
testcase_07 AC 58 ms
23,704 KB
testcase_08 AC 59 ms
21,608 KB
testcase_09 AC 58 ms
21,480 KB
testcase_10 AC 59 ms
21,604 KB
testcase_11 AC 59 ms
23,640 KB
testcase_12 AC 59 ms
21,684 KB
testcase_13 AC 58 ms
21,612 KB
testcase_14 AC 59 ms
19,612 KB
testcase_15 AC 59 ms
21,736 KB
testcase_16 AC 59 ms
21,612 KB
testcase_17 AC 62 ms
23,580 KB
testcase_18 AC 62 ms
23,864 KB
testcase_19 AC 62 ms
23,788 KB
testcase_20 AC 61 ms
23,576 KB
testcase_21 AC 61 ms
23,708 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.Linq;

class Program
{
    static void Main(string[] args)
    {
        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);
    }
}
0