結果

問題 No.601 Midpoint Erase
ユーザー tentententen
提出日時 2022-08-02 11:29:44
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,353 bytes
コンパイル時間 2,134 ms
コンパイル使用メモリ 74,296 KB
実行使用メモリ 58,240 KB
最終ジャッジ日時 2023-09-30 10:14:12
合計ジャッジ時間 7,148 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 44 ms
47,244 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 207 ms
55,940 KB
testcase_06 WA -
testcase_07 AC 230 ms
57,980 KB
testcase_08 WA -
testcase_09 AC 234 ms
56,588 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 190 ms
55,344 KB
testcase_13 AC 44 ms
49,272 KB
testcase_14 AC 44 ms
49,304 KB
testcase_15 AC 45 ms
49,308 KB
testcase_16 WA -
testcase_17 AC 43 ms
49,264 KB
testcase_18 AC 46 ms
49,516 KB
testcase_19 AC 45 ms
49,736 KB
testcase_20 WA -
testcase_21 AC 46 ms
49,292 KB
testcase_22 WA -
testcase_23 AC 45 ms
49,368 KB
testcase_24 WA -
testcase_25 AC 46 ms
49,300 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) {
                while (x > 0) {
                    ans += x / 2;
                    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