結果

問題 No.1183 コイン遊び
ユーザー tentententen
提出日時 2020-08-24 10:44:04
言語 Java21
(openjdk 21)
結果
AC  
実行時間 442 ms / 2,000 ms
コード長 566 bytes
コンパイル時間 2,616 ms
コンパイル使用メモリ 74,548 KB
実行使用メモリ 74,612 KB
最終ジャッジ日時 2024-04-24 02:00:35
合計ジャッジ時間 16,084 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 137 ms
53,852 KB
testcase_01 AC 119 ms
53,916 KB
testcase_02 AC 115 ms
53,812 KB
testcase_03 AC 117 ms
53,924 KB
testcase_04 AC 106 ms
40,128 KB
testcase_05 AC 115 ms
40,996 KB
testcase_06 AC 117 ms
41,544 KB
testcase_07 AC 115 ms
41,292 KB
testcase_08 AC 119 ms
40,136 KB
testcase_09 AC 147 ms
41,420 KB
testcase_10 AC 184 ms
42,400 KB
testcase_11 AC 218 ms
43,672 KB
testcase_12 AC 440 ms
58,852 KB
testcase_13 AC 439 ms
58,044 KB
testcase_14 AC 434 ms
63,996 KB
testcase_15 AC 442 ms
74,552 KB
testcase_16 AC 391 ms
64,880 KB
testcase_17 AC 425 ms
74,612 KB
testcase_18 AC 426 ms
64,880 KB
testcase_19 AC 426 ms
74,552 KB
testcase_20 AC 420 ms
64,656 KB
testcase_21 AC 411 ms
74,524 KB
testcase_22 AC 431 ms
65,004 KB
testcase_23 AC 381 ms
74,532 KB
testcase_24 AC 413 ms
64,956 KB
testcase_25 AC 427 ms
74,412 KB
testcase_26 AC 429 ms
64,920 KB
testcase_27 AC 427 ms
74,540 KB
testcase_28 AC 419 ms
64,956 KB
testcase_29 AC 385 ms
74,380 KB
testcase_30 AC 413 ms
64,956 KB
testcase_31 AC 433 ms
74,400 KB
testcase_32 AC 411 ms
64,896 KB
testcase_33 AC 419 ms
74,408 KB
testcase_34 AC 437 ms
64,884 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        sc.nextLine();
        char[] arr1 = sc.nextLine().toCharArray();
        char[] arr2 = sc.nextLine().toCharArray();
        boolean prev = true;
        int count = 0;
        for (int i = 0; i < arr1.length; i += 2) {
            boolean current = (arr1[i] == arr2[i]);
            if (prev && !current) {
                count++;
            }
            prev = current;
        }
        System.out.println(count);
    }
}
0