結果

問題 No.601 Midpoint Erase
ユーザー mokraimokrai
提出日時 2017-12-02 10:46:24
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 267 ms / 2,000 ms
コード長 1,070 bytes
コンパイル時間 107 ms
コンパイル使用メモリ 10,928 KB
実行使用メモリ 21,280 KB
最終ジャッジ日時 2023-08-24 18:45:30
合計ジャッジ時間 3,236 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,888 KB
testcase_01 AC 17 ms
7,856 KB
testcase_02 AC 16 ms
7,796 KB
testcase_03 AC 175 ms
16,576 KB
testcase_04 AC 203 ms
17,576 KB
testcase_05 AC 144 ms
14,952 KB
testcase_06 AC 87 ms
12,020 KB
testcase_07 AC 190 ms
17,236 KB
testcase_08 AC 161 ms
15,916 KB
testcase_09 AC 192 ms
17,316 KB
testcase_10 AC 55 ms
10,128 KB
testcase_11 AC 267 ms
21,280 KB
testcase_12 AC 130 ms
14,052 KB
testcase_13 AC 16 ms
7,876 KB
testcase_14 AC 16 ms
7,836 KB
testcase_15 AC 17 ms
7,832 KB
testcase_16 AC 16 ms
7,924 KB
testcase_17 AC 16 ms
7,768 KB
testcase_18 AC 17 ms
7,976 KB
testcase_19 AC 17 ms
7,864 KB
testcase_20 AC 17 ms
7,840 KB
testcase_21 AC 17 ms
7,960 KB
testcase_22 AC 16 ms
7,816 KB
testcase_23 AC 16 ms
7,948 KB
testcase_24 AC 16 ms
7,820 KB
testcase_25 AC 17 ms
7,864 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    N = int(input())
    points = []
    for i in range(N):
       x, y = map(int, input().split()) 
       points.append((x,y))
    #print(points)

    game_count = count_game_counts(points)
    #print(game_count)

    if game_count == 0:
        print("Bob")
    elif game_count % 2 == 1:
        print("Alice")
    else:
        print("Bob")

def count_game_counts(points):
    if len(points) == 0 or len(points) == 1:
        return 0

    odd_odd = 0
    odd_even = 0
    even_even = 0
    even_odd = 0

    for point in points:
        x, y = point
        if x % 2 == 0:
            if y % 2 == 0:
                even_even += 1
            else:
                even_odd += 1
        elif x % 2 == 1:
            if y % 2 == 1:
                odd_odd += 1
            else:
                odd_even += 1

    #print("even_even", even_even)
    #print("even_odd", even_odd)
    #print("odd_odd", odd_odd)
    #print("odd_even", odd_even)
    return even_even // 2 + even_odd // 2 + odd_odd // 2 + odd_even // 2

if __name__ == '__main__':
    main()
0