結果

問題 No.601 Midpoint Erase
ユーザー tentententen
提出日時 2022-10-06 16:54:43
言語 Java21
(openjdk 21)
結果
AC  
実行時間 255 ms / 2,000 ms
コード長 1,355 bytes
コンパイル時間 4,804 ms
コンパイル使用メモリ 73,952 KB
実行使用メモリ 58,420 KB
最終ジャッジ日時 2023-09-01 21:48:48
合計ジャッジ時間 9,454 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
49,592 KB
testcase_01 AC 45 ms
49,312 KB
testcase_02 AC 43 ms
49,224 KB
testcase_03 AC 223 ms
57,144 KB
testcase_04 AC 226 ms
56,860 KB
testcase_05 AC 203 ms
55,680 KB
testcase_06 AC 165 ms
54,824 KB
testcase_07 AC 226 ms
57,268 KB
testcase_08 AC 212 ms
55,980 KB
testcase_09 AC 226 ms
57,036 KB
testcase_10 AC 131 ms
54,652 KB
testcase_11 AC 255 ms
58,420 KB
testcase_12 AC 185 ms
55,772 KB
testcase_13 AC 43 ms
49,364 KB
testcase_14 AC 43 ms
49,184 KB
testcase_15 AC 44 ms
49,440 KB
testcase_16 AC 45 ms
49,236 KB
testcase_17 AC 44 ms
49,268 KB
testcase_18 AC 45 ms
49,228 KB
testcase_19 AC 46 ms
49,124 KB
testcase_20 AC 45 ms
49,276 KB
testcase_21 AC 45 ms
49,232 KB
testcase_22 AC 45 ms
49,244 KB
testcase_23 AC 45 ms
49,412 KB
testcase_24 AC 44 ms
49,232 KB
testcase_25 AC 46 ms
47,164 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner();
        int n = sc.nextInt();
        int[][] counts = new int[2][2];
        for (int i = 0; i < n; i++) {
            counts[sc.nextInt() % 2][sc.nextInt() % 2]++;
        }
        int ans = 0;
        for (int[] arr : counts) {
            for (int x : arr) {
                ans += x / 2;
            }
        }
        if (ans % 2 == 0) {
            System.out.println("Bob");
        } else {
            System.out.println("Alice");
        }
    }
}
class Scanner {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer st = new StringTokenizer("");
    StringBuilder sb = new StringBuilder();
    
    public Scanner() throws Exception {
        
    }
    
    public int nextInt() throws Exception {
        return Integer.parseInt(next());
    }
    
    public long nextLong() throws Exception {
        return Long.parseLong(next());
    }
    
    public double nextDouble() throws Exception {
        return Double.parseDouble(next());
    }
    
    public String next() throws Exception {
        while (!st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }
    
}
0