結果

問題 No.601 Midpoint Erase
ユーザー Mcpu3Mcpu3
提出日時 2018-10-21 13:26:54
言語 Java21
(openjdk 21)
結果
AC  
実行時間 900 ms / 2,000 ms
コード長 580 bytes
コンパイル時間 2,244 ms
コンパイル使用メモリ 74,968 KB
実行使用メモリ 54,564 KB
最終ジャッジ日時 2024-04-29 20:16:58
合計ジャッジ時間 12,694 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 147 ms
41,604 KB
testcase_01 AC 151 ms
41,656 KB
testcase_02 AC 138 ms
41,376 KB
testcase_03 AC 710 ms
50,112 KB
testcase_04 AC 788 ms
51,164 KB
testcase_05 AC 656 ms
47,880 KB
testcase_06 AC 560 ms
48,008 KB
testcase_07 AC 759 ms
51,204 KB
testcase_08 AC 716 ms
48,924 KB
testcase_09 AC 767 ms
51,456 KB
testcase_10 AC 434 ms
47,616 KB
testcase_11 AC 900 ms
54,564 KB
testcase_12 AC 676 ms
48,288 KB
testcase_13 AC 132 ms
41,256 KB
testcase_14 AC 128 ms
40,936 KB
testcase_15 AC 135 ms
41,308 KB
testcase_16 AC 147 ms
41,172 KB
testcase_17 AC 119 ms
40,188 KB
testcase_18 AC 146 ms
41,264 KB
testcase_19 AC 148 ms
41,776 KB
testcase_20 AC 142 ms
41,676 KB
testcase_21 AC 147 ms
41,652 KB
testcase_22 AC 145 ms
41,340 KB
testcase_23 AC 135 ms
41,540 KB
testcase_24 AC 139 ms
41,616 KB
testcase_25 AC 142 ms
41,056 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt(), x, y, sum = 0, tmp[] = new int[4];
		for (int i = 0; i < N; ++i) {
			x = sc.nextInt();
			y = sc.nextInt();
			if (x % 2 == 0 && y % 2 == 0) ++tmp[0];
			else if (x % 2 == 0 && y % 2 == 1) ++tmp[1];
			else if (x % 2 == 1 && y % 2 == 0) ++tmp[2];
			else ++tmp[3];
		}
		sc.close();
		for (int i = 0; i < 4; ++i) sum += tmp[i] / 2;
		if (sum % 2 == 0) System.out.print("Bob");
		else System.out.print("Alice");
	}
}
0