結果

問題 No.224 文字列変更(easy)
ユーザー matsuyoshi30matsuyoshi30
提出日時 2017-01-10 23:15:37
言語 Java21
(openjdk 21)
結果
AC  
実行時間 127 ms / 5,000 ms
コード長 644 bytes
コンパイル時間 2,067 ms
コンパイル使用メモリ 72,016 KB
実行使用メモリ 56,372 KB
最終ジャッジ日時 2023-09-25 02:21:18
合計ジャッジ時間 5,943 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
55,748 KB
testcase_01 AC 127 ms
55,988 KB
testcase_02 AC 122 ms
55,752 KB
testcase_03 AC 121 ms
55,876 KB
testcase_04 AC 122 ms
56,052 KB
testcase_05 AC 122 ms
55,828 KB
testcase_06 AC 122 ms
56,008 KB
testcase_07 AC 124 ms
56,372 KB
testcase_08 AC 123 ms
55,988 KB
testcase_09 AC 123 ms
55,620 KB
testcase_10 AC 124 ms
55,820 KB
testcase_11 AC 124 ms
55,960 KB
testcase_12 AC 121 ms
55,968 KB
testcase_13 AC 122 ms
56,036 KB
testcase_14 AC 124 ms
56,120 KB
testcase_15 AC 123 ms
56,124 KB
testcase_16 AC 122 ms
55,584 KB
testcase_17 AC 126 ms
55,932 KB
testcase_18 AC 126 ms
55,884 KB
testcase_19 AC 127 ms
55,956 KB
testcase_20 AC 126 ms
55,952 KB
testcase_21 AC 127 ms
56,220 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;

class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        String s = in.next();
        String t = in.next();
        int count = 0;
        char[] s_to_c = s.toCharArray();
        char[] t_to_c = t.toCharArray();

        for(int i=0; i<n; i++) {
            if(s_to_c[i] != t_to_c[i]) {
                count++;
            } else {
                // nothing
            }
        }

        System.out.println(count);

        in.close();
    }
}
0