結果

問題 No.202 1円玉投げ
ユーザー しらっ亭しらっ亭
提出日時 2015-06-26 01:50:43
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 2,141 ms / 5,000 ms
コード長 759 bytes
コンパイル時間 78 ms
コンパイル使用メモリ 10,920 KB
実行使用メモリ 309,232 KB
最終ジャッジ日時 2023-08-23 23:04:24
合計ジャッジ時間 35,374 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,844 ms
193,484 KB
testcase_01 AC 2,089 ms
309,232 KB
testcase_02 AC 18 ms
8,540 KB
testcase_03 AC 18 ms
8,588 KB
testcase_04 AC 18 ms
8,520 KB
testcase_05 AC 101 ms
26,788 KB
testcase_06 AC 1,767 ms
229,208 KB
testcase_07 AC 1,962 ms
277,244 KB
testcase_08 AC 1,987 ms
277,328 KB
testcase_09 AC 1,026 ms
159,320 KB
testcase_10 AC 393 ms
76,016 KB
testcase_11 AC 898 ms
142,920 KB
testcase_12 AC 921 ms
142,996 KB
testcase_13 AC 476 ms
81,380 KB
testcase_14 AC 122 ms
29,688 KB
testcase_15 AC 1,010 ms
154,964 KB
testcase_16 AC 1,855 ms
209,756 KB
testcase_17 AC 1,826 ms
209,784 KB
testcase_18 AC 1,842 ms
209,720 KB
testcase_19 AC 982 ms
147,736 KB
testcase_20 AC 1,488 ms
210,612 KB
testcase_21 AC 966 ms
146,628 KB
testcase_22 AC 30 ms
10,764 KB
testcase_23 AC 30 ms
11,016 KB
testcase_24 AC 24 ms
8,856 KB
testcase_25 AC 24 ms
8,800 KB
testcase_26 AC 31 ms
10,812 KB
testcase_27 AC 31 ms
10,868 KB
testcase_28 AC 24 ms
8,828 KB
testcase_29 AC 24 ms
8,892 KB
testcase_30 AC 31 ms
11,200 KB
testcase_31 AC 23 ms
8,780 KB
testcase_32 AC 33 ms
11,440 KB
testcase_33 AC 28 ms
9,888 KB
testcase_34 AC 31 ms
9,976 KB
testcase_35 AC 1,741 ms
178,736 KB
testcase_36 AC 1,864 ms
191,892 KB
testcase_37 AC 2,141 ms
286,856 KB
testcase_38 AC 1,822 ms
191,620 KB
testcase_39 AC 22 ms
9,092 KB
testcase_40 AC 21 ms
8,936 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