結果

問題 No.601 Midpoint Erase
コンテスト
ユーザー daku9640
提出日時 2017-12-02 03:06:23
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
MLE  
実行時間 -
コード長 849 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 581 ms
コンパイル使用メモリ 20,952 KB
実行使用メモリ 311,504 KB
最終ジャッジ日時 2026-05-22 06:13:39
合計ジャッジ時間 4,722 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample -- * 3
other AC * 2 MLE * 2 -- * 19
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

from collections import defaultdict
N = int(input())
li = tuple(tuple(map(int, input().split())) for _ in range(N))
MAP = defaultdict(set)
LIST = []
for i in range(N - 1):
    for j in range(i + 1, N):
        x = (li[i][0] - li[j][0])
        y = (li[i][1] - li[j][1])
        if abs(x) in (0, 1) or abs(y) in (0, 1): continue
        if x % 2 == 0 and y % 2 == 0:
            MAP[li[i]].add(li[j])
            MAP[li[j]].add(li[i])
            LIST.append({li[i], li[j]})
cnt = 0
for fi, se in LIST:
    if MAP[fi] and MAP[se]:
        for z in MAP[fi]:
            MAP[z].remove(fi)
            if not MAP[z]:
                del MAP[z]
        for z in MAP[se]:
            MAP[z].remove(se)
            if not MAP[z]:
                del MAP[z]
        del MAP[fi]
        del MAP[se]
        cnt += 1
print("Bob" if cnt % 2 == 0 else "Alice")
0