結果

問題 No.601 Midpoint Erase
ユーザー tentententen
提出日時 2022-08-02 11:30:38
言語 Java21
(openjdk 21)
結果
AC  
実行時間 264 ms / 2,000 ms
コード長 1,271 bytes
コンパイル時間 2,037 ms
コンパイル使用メモリ 74,396 KB
実行使用メモリ 59,368 KB
最終ジャッジ日時 2023-09-30 10:15:33
合計ジャッジ時間 6,232 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
49,300 KB
testcase_01 AC 46 ms
49,248 KB
testcase_02 AC 45 ms
49,456 KB
testcase_03 AC 226 ms
57,552 KB
testcase_04 AC 237 ms
59,368 KB
testcase_05 AC 201 ms
55,996 KB
testcase_06 AC 169 ms
54,640 KB
testcase_07 AC 238 ms
57,008 KB
testcase_08 AC 207 ms
56,408 KB
testcase_09 AC 235 ms
56,860 KB
testcase_10 AC 141 ms
55,056 KB
testcase_11 AC 264 ms
58,160 KB
testcase_12 AC 195 ms
55,476 KB
testcase_13 AC 43 ms
49,448 KB
testcase_14 AC 43 ms
49,372 KB
testcase_15 AC 44 ms
49,832 KB
testcase_16 AC 45 ms
49,304 KB
testcase_17 AC 44 ms
49,432 KB
testcase_18 AC 45 ms
49,484 KB
testcase_19 AC 45 ms
49,304 KB
testcase_20 AC 44 ms
49,336 KB
testcase_21 AC 46 ms
49,484 KB
testcase_22 AC 49 ms
49,412 KB
testcase_23 AC 44 ms
49,360 KB
testcase_24 AC 45 ms
49,300 KB
testcase_25 AC 45 ms
49,304 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;
            }
        }
        String[] names = new String[]{"Bob", "Alice"};
        System.out.println(names[ans % 2]);
    }
}

class Scanner {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer st = new StringTokenizer("");
    
    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