結果

問題 No.1183 コイン遊び
ユーザー rymg111rymg111
提出日時 2020-09-22 23:25:25
言語 Java21
(openjdk 21)
結果
AC  
実行時間 1,640 ms / 2,000 ms
コード長 607 bytes
コンパイル時間 2,013 ms
コンパイル使用メモリ 71,352 KB
実行使用メモリ 78,188 KB
最終ジャッジ日時 2023-09-09 06:46:15
合計ジャッジ時間 41,931 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
56,164 KB
testcase_01 AC 122 ms
55,920 KB
testcase_02 AC 124 ms
55,464 KB
testcase_03 AC 121 ms
56,004 KB
testcase_04 AC 120 ms
56,092 KB
testcase_05 AC 120 ms
56,116 KB
testcase_06 AC 120 ms
55,812 KB
testcase_07 AC 121 ms
55,920 KB
testcase_08 AC 187 ms
58,508 KB
testcase_09 AC 182 ms
58,436 KB
testcase_10 AC 332 ms
60,112 KB
testcase_11 AC 482 ms
60,588 KB
testcase_12 AC 1,161 ms
71,032 KB
testcase_13 AC 1,130 ms
69,344 KB
testcase_14 AC 1,506 ms
70,340 KB
testcase_15 AC 1,512 ms
71,096 KB
testcase_16 AC 1,533 ms
71,364 KB
testcase_17 AC 1,545 ms
70,588 KB
testcase_18 AC 1,522 ms
70,264 KB
testcase_19 AC 1,500 ms
71,824 KB
testcase_20 AC 1,521 ms
72,212 KB
testcase_21 AC 1,495 ms
71,208 KB
testcase_22 AC 1,523 ms
71,048 KB
testcase_23 AC 1,588 ms
77,696 KB
testcase_24 AC 1,610 ms
78,188 KB
testcase_25 AC 1,541 ms
70,944 KB
testcase_26 AC 1,626 ms
77,664 KB
testcase_27 AC 1,524 ms
71,296 KB
testcase_28 AC 1,554 ms
70,824 KB
testcase_29 AC 1,494 ms
70,392 KB
testcase_30 AC 1,507 ms
70,788 KB
testcase_31 AC 1,511 ms
71,436 KB
testcase_32 AC 1,640 ms
77,584 KB
testcase_33 AC 1,594 ms
69,836 KB
testcase_34 AC 1,529 ms
70,236 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;
		int index = 0;
		while(index != length) {
			if(before[index] != after[index]) {
				if(index == length - 1 || before[index + 1] == after[index + 1]) {
					count++;
				}
			}
			index++;
		}
		System.out.println(count);
	}
}
0