結果

問題 No.202 1円玉投げ
ユーザー しらっ亭しらっ亭
提出日時 2015-06-26 01:51:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 861 ms / 5,000 ms
コード長 759 bytes
コンパイル時間 272 ms
コンパイル使用メモリ 82,384 KB
実行使用メモリ 319,032 KB
最終ジャッジ日時 2024-06-01 20:30:08
合計ジャッジ時間 15,523 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 626 ms
223,232 KB
testcase_01 AC 821 ms
319,032 KB
testcase_02 AC 37 ms
55,108 KB
testcase_03 AC 36 ms
54,324 KB
testcase_04 AC 36 ms
54,900 KB
testcase_05 AC 113 ms
90,304 KB
testcase_06 AC 729 ms
279,496 KB
testcase_07 AC 781 ms
286,064 KB
testcase_08 AC 783 ms
285,860 KB
testcase_09 AC 434 ms
198,064 KB
testcase_10 AC 239 ms
120,640 KB
testcase_11 AC 386 ms
167,904 KB
testcase_12 AC 394 ms
185,508 KB
testcase_13 AC 249 ms
130,924 KB
testcase_14 AC 117 ms
90,696 KB
testcase_15 AC 417 ms
199,432 KB
testcase_16 AC 675 ms
281,492 KB
testcase_17 AC 686 ms
281,696 KB
testcase_18 AC 702 ms
281,684 KB
testcase_19 AC 400 ms
182,976 KB
testcase_20 AC 640 ms
276,668 KB
testcase_21 AC 395 ms
183,908 KB
testcase_22 AC 75 ms
77,372 KB
testcase_23 AC 75 ms
77,628 KB
testcase_24 AC 62 ms
73,184 KB
testcase_25 AC 63 ms
73,076 KB
testcase_26 AC 70 ms
77,668 KB
testcase_27 AC 78 ms
77,304 KB
testcase_28 AC 64 ms
72,844 KB
testcase_29 AC 64 ms
72,192 KB
testcase_30 AC 79 ms
78,144 KB
testcase_31 AC 58 ms
71,000 KB
testcase_32 AC 67 ms
75,288 KB
testcase_33 AC 78 ms
77,276 KB
testcase_34 AC 81 ms
77,016 KB
testcase_35 AC 629 ms
222,860 KB
testcase_36 AC 644 ms
222,800 KB
testcase_37 AC 861 ms
283,144 KB
testcase_38 AC 611 ms
222,732 KB
testcase_39 AC 51 ms
66,468 KB
testcase_40 AC 48 ms
64,976 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict


def lap(bin, x, y, dx, dy):

    cs = []
    for xx in [-1, 0, 1]:
        for yy in [-1, 0, 1]:
            cs.extend(bin[dx + xx, dy + yy])

    for bx, by in cs:
        if (bx - x) ** 2 + (by - y) ** 2 < 400:
            return True

    for xx in [-1, 0, 1]:
        for yy in [-1, 0, 1]:
            bin[dx + xx, dy + yy].append((x, y))

    return False


def solve(XY):
    bin = defaultdict(list)

    count = 0
    for x, y in XY:
        dx = x // 10
        dy = y // 10
        if not lap(bin, x, y, dx, dy):
            count += 1

    return count


def main():
    N = int(input())
    XY = [list(map(int, input().split())) for i in range(N)]

    print(solve(XY))


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