結果

問題 No.224 文字列変更(easy)
ユーザー takeya_okinotakeya_okino
提出日時 2017-06-25 11:36:07
言語 Java19
(openjdk 21)
結果
AC  
実行時間 131 ms / 5,000 ms
コード長 377 bytes
コンパイル時間 1,858 ms
コンパイル使用メモリ 71,548 KB
実行使用メモリ 56,448 KB
最終ジャッジ日時 2023-09-25 02:27:11
合計ジャッジ時間 5,798 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
55,812 KB
testcase_01 AC 131 ms
55,808 KB
testcase_02 AC 123 ms
56,392 KB
testcase_03 AC 125 ms
55,788 KB
testcase_04 AC 122 ms
55,816 KB
testcase_05 AC 122 ms
55,820 KB
testcase_06 AC 123 ms
56,060 KB
testcase_07 AC 123 ms
55,796 KB
testcase_08 AC 123 ms
55,688 KB
testcase_09 AC 124 ms
55,852 KB
testcase_10 AC 122 ms
55,716 KB
testcase_11 AC 122 ms
56,152 KB
testcase_12 AC 124 ms
56,300 KB
testcase_13 AC 123 ms
56,144 KB
testcase_14 AC 121 ms
56,292 KB
testcase_15 AC 122 ms
56,448 KB
testcase_16 AC 122 ms
56,392 KB
testcase_17 AC 126 ms
56,116 KB
testcase_18 AC 127 ms
56,144 KB
testcase_19 AC 127 ms
55,828 KB
testcase_20 AC 127 ms
55,620 KB
testcase_21 AC 131 ms
55,936 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    String S = sc.next();
    String T = sc.next();
    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