結果

問題 No.601 Midpoint Erase
ユーザー htensaihtensai
提出日時 2019-11-14 11:41:44
言語 Java21
(openjdk 21)
結果
AC  
実行時間 797 ms / 2,000 ms
コード長 747 bytes
コンパイル時間 2,026 ms
コンパイル使用メモリ 74,516 KB
実行使用メモリ 69,448 KB
最終ジャッジ日時 2023-10-21 19:57:18
合計ジャッジ時間 12,184 ms
ジャッジサーバーID
(参考情報)
judge11 / judge10
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 143 ms
57,432 KB
testcase_01 AC 155 ms
57,608 KB
testcase_02 AC 137 ms
57,652 KB
testcase_03 AC 659 ms
65,072 KB
testcase_04 AC 690 ms
66,368 KB
testcase_05 AC 600 ms
62,460 KB
testcase_06 AC 494 ms
62,052 KB
testcase_07 AC 680 ms
66,100 KB
testcase_08 AC 633 ms
64,040 KB
testcase_09 AC 694 ms
66,268 KB
testcase_10 AC 418 ms
61,980 KB
testcase_11 AC 797 ms
69,448 KB
testcase_12 AC 594 ms
62,136 KB
testcase_13 AC 134 ms
57,448 KB
testcase_14 AC 135 ms
57,408 KB
testcase_15 AC 141 ms
57,144 KB
testcase_16 AC 145 ms
57,612 KB
testcase_17 AC 135 ms
57,392 KB
testcase_18 AC 151 ms
57,676 KB
testcase_19 AC 154 ms
57,656 KB
testcase_20 AC 147 ms
57,732 KB
testcase_21 AC 148 ms
57,668 KB
testcase_22 AC 151 ms
57,708 KB
testcase_23 AC 143 ms
57,680 KB
testcase_24 AC 144 ms
57,444 KB
testcase_25 AC 147 ms
57,488 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int typeEE = 0;
		int typeEO = 0;
		int typeOE = 0;
		int typeOO = 0;
		for (int i = 0; i < n; i++) {
		    int x =sc.nextInt();
		    int y =sc.nextInt();
		    if (x % 2 == 0) {
		        if (y % 2 == 0) {
		            typeEE++;
		        } else {
		            typeEO++;
		        }
		    } else {
		        if (y % 2 == 0) {
		            typeOE++;
		        } else {
		            typeOO++;
		        }
		    }
		}
		int count = typeEE /2 + typeEO / 2 +  typeOE / 2 + typeOO / 2;
		if (count % 2 == 0) {
		    System.out.println("Bob");
		} else {
		    System.out.println("Alice");
		}
	}
}
0