結果

問題 No.202 1円玉投げ
ユーザー しらっ亭しらっ亭
提出日時 2015-06-26 02:07:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 932 ms / 5,000 ms
コード長 1,135 bytes
コンパイル時間 282 ms
コンパイル使用メモリ 86,980 KB
実行使用メモリ 271,832 KB
最終ジャッジ日時 2023-08-23 23:04:58
合計ジャッジ時間 20,371 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 590 ms
245,276 KB
testcase_01 AC 630 ms
270,820 KB
testcase_02 AC 233 ms
181,424 KB
testcase_03 AC 233 ms
181,476 KB
testcase_04 AC 234 ms
181,480 KB
testcase_05 AC 310 ms
207,812 KB
testcase_06 AC 784 ms
263,100 KB
testcase_07 AC 827 ms
267,752 KB
testcase_08 AC 822 ms
265,224 KB
testcase_09 AC 555 ms
240,096 KB
testcase_10 AC 366 ms
213,412 KB
testcase_11 AC 509 ms
234,356 KB
testcase_12 AC 511 ms
233,796 KB
testcase_13 AC 361 ms
211,620 KB
testcase_14 AC 305 ms
206,672 KB
testcase_15 AC 551 ms
238,612 KB
testcase_16 AC 507 ms
257,436 KB
testcase_17 AC 558 ms
258,264 KB
testcase_18 AC 545 ms
257,940 KB
testcase_19 AC 560 ms
240,320 KB
testcase_20 AC 722 ms
259,480 KB
testcase_21 AC 550 ms
239,964 KB
testcase_22 AC 279 ms
199,136 KB
testcase_23 AC 274 ms
199,212 KB
testcase_24 AC 266 ms
199,152 KB
testcase_25 AC 262 ms
199,072 KB
testcase_26 AC 272 ms
199,132 KB
testcase_27 AC 271 ms
199,256 KB
testcase_28 AC 269 ms
198,984 KB
testcase_29 AC 274 ms
199,000 KB
testcase_30 AC 275 ms
199,228 KB
testcase_31 AC 270 ms
199,072 KB
testcase_32 AC 270 ms
199,160 KB
testcase_33 AC 269 ms
199,036 KB
testcase_34 AC 275 ms
199,288 KB
testcase_35 AC 504 ms
242,272 KB
testcase_36 AC 573 ms
246,676 KB
testcase_37 AC 932 ms
271,832 KB
testcase_38 AC 514 ms
247,092 KB
testcase_39 AC 265 ms
203,232 KB
testcase_40 AC 260 ms
203,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

    cs = []

    cs.extend(bin[dx][dy])
    cs.extend(bin[dx][dy + 1])
    cs.extend(bin[dx][dy + 2])
    cs.extend(bin[dx + 1][dy])
    cs.extend(bin[dx + 1][dy + 1])
    cs.extend(bin[dx + 1][dy + 2])
    cs.extend(bin[dx + 2][dy])
    cs.extend(bin[dx + 2][dy + 1])
    cs.extend(bin[dx + 2][dy + 2])

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

    t = (x, y)
    bin[dx][dy].append(t)
    bin[dx][dy + 1].append(t)
    bin[dx][dy + 2].append(t)
    bin[dx + 1][dy].append(t)
    bin[dx + 1][dy + 1].append(t)
    bin[dx + 1][dy + 2].append(t)
    bin[dx + 2][dy].append(t)
    bin[dx + 2][dy + 1].append(t)
    bin[dx + 2][dy + 2].append(t)

    return False


def solve(XY):
    bin = [[[] for j in range(2003)] for i in range(2003)]

    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