結果

問題 No.202 1円玉投げ
ユーザー しらっ亭しらっ亭
提出日時 2015-06-26 01:51:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,021 ms / 5,000 ms
コード長 759 bytes
コンパイル時間 331 ms
コンパイル使用メモリ 86,912 KB
実行使用メモリ 320,196 KB
最終ジャッジ日時 2023-08-23 23:03:45
合計ジャッジ時間 20,621 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 800 ms
227,136 KB
testcase_01 AC 993 ms
320,196 KB
testcase_02 AC 92 ms
71,664 KB
testcase_03 AC 88 ms
71,720 KB
testcase_04 AC 88 ms
71,516 KB
testcase_05 AC 184 ms
96,816 KB
testcase_06 AC 871 ms
287,808 KB
testcase_07 AC 957 ms
289,488 KB
testcase_08 AC 961 ms
289,584 KB
testcase_09 AC 572 ms
203,784 KB
testcase_10 AC 324 ms
124,528 KB
testcase_11 AC 496 ms
173,964 KB
testcase_12 AC 494 ms
182,744 KB
testcase_13 AC 346 ms
137,444 KB
testcase_14 AC 187 ms
96,224 KB
testcase_15 AC 557 ms
205,740 KB
testcase_16 AC 836 ms
276,960 KB
testcase_17 AC 838 ms
277,264 KB
testcase_18 AC 846 ms
277,420 KB
testcase_19 AC 522 ms
188,032 KB
testcase_20 AC 790 ms
280,016 KB
testcase_21 AC 517 ms
188,216 KB
testcase_22 AC 129 ms
77,788 KB
testcase_23 AC 127 ms
77,884 KB
testcase_24 AC 116 ms
77,716 KB
testcase_25 AC 124 ms
77,464 KB
testcase_26 AC 127 ms
77,740 KB
testcase_27 AC 139 ms
77,664 KB
testcase_28 AC 125 ms
77,672 KB
testcase_29 AC 127 ms
77,688 KB
testcase_30 AC 136 ms
78,044 KB
testcase_31 AC 117 ms
77,352 KB
testcase_32 AC 122 ms
78,364 KB
testcase_33 AC 133 ms
77,608 KB
testcase_34 AC 131 ms
77,504 KB
testcase_35 AC 763 ms
228,028 KB
testcase_36 AC 795 ms
228,052 KB
testcase_37 AC 1,021 ms
286,548 KB
testcase_38 AC 743 ms
227,704 KB
testcase_39 AC 105 ms
77,492 KB
testcase_40 AC 100 ms
77,040 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