結果

問題 No.1183 コイン遊び
ユーザー rymg111rymg111
提出日時 2020-09-22 23:36:55
言語 Java21
(openjdk 21)
結果
AC  
実行時間 1,640 ms / 2,000 ms
コード長 584 bytes
コンパイル時間 2,206 ms
コンパイル使用メモリ 71,228 KB
実行使用メモリ 72,820 KB
最終ジャッジ日時 2023-09-09 06:58:23
合計ジャッジ時間 42,314 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
55,824 KB
testcase_01 AC 124 ms
42,652 KB
testcase_02 AC 126 ms
39,428 KB
testcase_03 AC 122 ms
39,076 KB
testcase_04 AC 124 ms
39,528 KB
testcase_05 AC 126 ms
39,356 KB
testcase_06 AC 129 ms
39,480 KB
testcase_07 AC 126 ms
39,092 KB
testcase_08 AC 183 ms
41,552 KB
testcase_09 AC 194 ms
41,280 KB
testcase_10 AC 346 ms
45,912 KB
testcase_11 AC 477 ms
46,676 KB
testcase_12 AC 1,307 ms
62,032 KB
testcase_13 AC 1,163 ms
68,004 KB
testcase_14 AC 1,544 ms
63,816 KB
testcase_15 AC 1,582 ms
71,248 KB
testcase_16 AC 1,581 ms
56,840 KB
testcase_17 AC 1,570 ms
56,796 KB
testcase_18 AC 1,558 ms
57,148 KB
testcase_19 AC 1,543 ms
56,752 KB
testcase_20 AC 1,569 ms
57,596 KB
testcase_21 AC 1,540 ms
64,828 KB
testcase_22 AC 1,536 ms
70,704 KB
testcase_23 AC 1,493 ms
63,828 KB
testcase_24 AC 1,569 ms
57,548 KB
testcase_25 AC 1,542 ms
57,000 KB
testcase_26 AC 1,595 ms
56,952 KB
testcase_27 AC 1,586 ms
72,820 KB
testcase_28 AC 1,588 ms
64,360 KB
testcase_29 AC 1,549 ms
70,396 KB
testcase_30 AC 1,490 ms
61,496 KB
testcase_31 AC 1,601 ms
64,580 KB
testcase_32 AC 1,562 ms
70,132 KB
testcase_33 AC 1,622 ms
58,232 KB
testcase_34 AC 1,640 ms
64,552 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int length = sc.nextInt();
		int[] before = new int[length];
		for(int i = 0; i < length; i++) {
			before[i] = sc.nextInt();
		}
		int[] after = new int[length];
		for(int j = 0; j < length; j++) {
			after[j] = sc.nextInt();
		}
		int count = 0;
		if(before[0] != after[0]) {
			count++;
		}
		for(int i = 0; i < length - 1; i++) {
			if(before[i] == after[i] && before[i + 1] != after[i + 1]) {
				count++;
			}
		}
		System.out.println(count);
	}
}
0