結果

問題 No.601 Midpoint Erase
ユーザー takeya_okinotakeya_okino
提出日時 2019-08-25 14:29:57
言語 Java21
(openjdk 21)
結果
AC  
実行時間 654 ms / 2,000 ms
コード長 650 bytes
コンパイル時間 2,917 ms
コンパイル使用メモリ 83,768 KB
実行使用メモリ 53,868 KB
最終ジャッジ日時 2024-04-24 07:26:01
合計ジャッジ時間 11,404 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
41,200 KB
testcase_01 AC 123 ms
41,208 KB
testcase_02 AC 112 ms
41,156 KB
testcase_03 AC 627 ms
49,588 KB
testcase_04 AC 650 ms
51,612 KB
testcase_05 AC 565 ms
48,132 KB
testcase_06 AC 484 ms
47,924 KB
testcase_07 AC 646 ms
49,944 KB
testcase_08 AC 614 ms
49,092 KB
testcase_09 AC 653 ms
50,280 KB
testcase_10 AC 360 ms
46,844 KB
testcase_11 AC 654 ms
53,868 KB
testcase_12 AC 570 ms
48,048 KB
testcase_13 AC 115 ms
41,304 KB
testcase_14 AC 113 ms
41,220 KB
testcase_15 AC 110 ms
40,080 KB
testcase_16 AC 121 ms
41,148 KB
testcase_17 AC 108 ms
40,712 KB
testcase_18 AC 144 ms
41,688 KB
testcase_19 AC 125 ms
41,620 KB
testcase_20 AC 125 ms
41,480 KB
testcase_21 AC 124 ms
41,440 KB
testcase_22 AC 122 ms
41,396 KB
testcase_23 AC 111 ms
40,980 KB
testcase_24 AC 122 ms
41,296 KB
testcase_25 AC 126 ms
41,384 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[] 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