結果

問題 No.224 文字列変更(easy)
ユーザー tentententen
提出日時 2020-11-11 08:42:44
言語 Java21
(openjdk 21)
結果
AC  
実行時間 124 ms / 5,000 ms
コード長 433 bytes
コンパイル時間 1,961 ms
コンパイル使用メモリ 71,008 KB
実行使用メモリ 56,444 KB
最終ジャッジ日時 2023-09-30 00:22:01
合計ジャッジ時間 5,731 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 114 ms
55,672 KB
testcase_01 AC 122 ms
55,836 KB
testcase_02 AC 117 ms
55,924 KB
testcase_03 AC 116 ms
55,736 KB
testcase_04 AC 117 ms
55,864 KB
testcase_05 AC 115 ms
55,396 KB
testcase_06 AC 110 ms
55,764 KB
testcase_07 AC 114 ms
55,920 KB
testcase_08 AC 116 ms
55,688 KB
testcase_09 AC 115 ms
56,444 KB
testcase_10 AC 113 ms
55,540 KB
testcase_11 AC 113 ms
55,860 KB
testcase_12 AC 112 ms
55,704 KB
testcase_13 AC 113 ms
56,136 KB
testcase_14 AC 114 ms
55,388 KB
testcase_15 AC 115 ms
55,960 KB
testcase_16 AC 111 ms
55,908 KB
testcase_17 AC 124 ms
56,364 KB
testcase_18 AC 119 ms
55,552 KB
testcase_19 AC 120 ms
56,056 KB
testcase_20 AC 120 ms
55,596 KB
testcase_21 AC 123 ms
55,356 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        char[] s = sc.next().toCharArray();
        char[] t = sc.next().toCharArray();
        int count = 0;
        for (int i = 0; i < n; i++) {
            if (s[i] != t[i]) {
                count++;
            }
        }
        System.out.println(count);
    }
}
0