結果

問題 No.224 文字列変更(easy)
ユーザー YamaKasaYamaKasa
提出日時 2018-04-30 01:06:33
言語 Java21
(openjdk 21)
結果
AC  
実行時間 134 ms / 5,000 ms
コード長 393 bytes
コンパイル時間 5,727 ms
コンパイル使用メモリ 71,208 KB
実行使用メモリ 56,024 KB
最終ジャッジ日時 2023-09-25 02:39:40
合計ジャッジ時間 9,357 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
55,792 KB
testcase_01 AC 131 ms
56,024 KB
testcase_02 AC 125 ms
55,484 KB
testcase_03 AC 127 ms
55,700 KB
testcase_04 AC 128 ms
55,516 KB
testcase_05 AC 126 ms
55,696 KB
testcase_06 AC 127 ms
55,980 KB
testcase_07 AC 129 ms
55,616 KB
testcase_08 AC 127 ms
55,688 KB
testcase_09 AC 127 ms
55,800 KB
testcase_10 AC 128 ms
55,732 KB
testcase_11 AC 129 ms
55,760 KB
testcase_12 AC 126 ms
55,784 KB
testcase_13 AC 127 ms
55,940 KB
testcase_14 AC 129 ms
55,716 KB
testcase_15 AC 126 ms
55,788 KB
testcase_16 AC 126 ms
55,912 KB
testcase_17 AC 134 ms
55,480 KB
testcase_18 AC 131 ms
55,900 KB
testcase_19 AC 131 ms
56,008 KB
testcase_20 AC 132 ms
55,936 KB
testcase_21 AC 132 ms
55,928 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		String S = scan.next();
		String T = scan.next();
		scan.close();

		int ans = 0;
		for(int i = 0; i < n; i++) {
			char c1 = S.charAt(i);
			char c2 = T.charAt(i);
			if(c1 != c2) {
				ans ++;
			}
		}
		System.out.println(ans);
	}
}
0