結果

問題 No.601 Midpoint Erase
ユーザー YamaKasaYamaKasa
提出日時 2018-09-26 15:27:57
言語 Java21
(openjdk 21)
結果
AC  
実行時間 856 ms / 2,000 ms
コード長 732 bytes
コンパイル時間 2,476 ms
コンパイル使用メモリ 77,492 KB
実行使用メモリ 65,552 KB
最終ジャッジ日時 2024-04-19 05:42:26
合計ジャッジ時間 12,607 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 137 ms
53,928 KB
testcase_01 AC 143 ms
53,864 KB
testcase_02 AC 117 ms
52,820 KB
testcase_03 AC 720 ms
60,652 KB
testcase_04 AC 764 ms
62,748 KB
testcase_05 AC 617 ms
59,308 KB
testcase_06 AC 538 ms
59,692 KB
testcase_07 AC 638 ms
62,412 KB
testcase_08 AC 661 ms
60,356 KB
testcase_09 AC 742 ms
62,636 KB
testcase_10 AC 436 ms
59,464 KB
testcase_11 AC 856 ms
65,552 KB
testcase_12 AC 650 ms
59,408 KB
testcase_13 AC 127 ms
54,408 KB
testcase_14 AC 130 ms
54,184 KB
testcase_15 AC 131 ms
54,144 KB
testcase_16 AC 139 ms
54,204 KB
testcase_17 AC 128 ms
53,996 KB
testcase_18 AC 141 ms
54,356 KB
testcase_19 AC 142 ms
54,148 KB
testcase_20 AC 142 ms
54,184 KB
testcase_21 AC 142 ms
54,376 KB
testcase_22 AC 147 ms
54,136 KB
testcase_23 AC 120 ms
54,484 KB
testcase_24 AC 137 ms
54,232 KB
testcase_25 AC 137 ms
54,280 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();
		int[]x = new int[N];
		int[]y = new int[N];
		for(int i = 0; i < N; i++) {
			x[i] = scan.nextInt();
			y[i] = scan.nextInt();
		}
		scan.close();
		int c1 = 0;
		int c2 = 0;
		int c3 = 0;
		int c4 = 0;
		for(int i = 0; i < N; i++) {
			if(x[i] % 2 == 0 && y[i] % 2 == 0) {
				c1++;
			}else if(x[i] % 2 == 0 && y[i] % 2 == 1) {
				c2++;
			}else if(x[i] % 2 == 1 && y[i] % 2 == 0) {
				c3++;
			}else {
				c4++;
			}
		}
		int cnt = c1 / 2 + c2 / 2 + c3 / 2 + c4 / 2;
		if(cnt % 2 == 0) {
			System.out.println("Bob");
		}else {
			System.out.println("Alice");
		}
	}
}
0