結果

問題 No.601 Midpoint Erase
ユーザー takeya_okino
提出日時 2019-08-25 14:29:57
言語 Java
(openjdk 23)
結果
AC  
実行時間 857 ms / 2,000 ms
コード長 650 bytes
コンパイル時間 2,969 ms
コンパイル使用メモリ 74,916 KB
実行使用メモリ 65,400 KB
最終ジャッジ日時 2024-11-06 14:41:54
合計ジャッジ時間 14,241 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int[] a = new int[4];
    for(int i = 0; i < n; i++) {
      int x = sc.nextInt();
      int y = sc.nextInt();
      if((x % 2) == 0) {
        if((y % 2) == 0) {
          a[0]++;
        } else {
          a[1]++;
        }
      } else {
        if((y % 2) == 0) {
          a[2]++;
        } else {
          a[3]++;
        }
      }
    }
    String ans = "Alice";
    int p = a[0] / 2 + a[1] / 2 + a[2] / 2 + a[3] / 2;
    if((p % 2) == 0) ans = "Bob";
    System.out.println(ans);
  }
}
0