結果

問題 No.202 1円玉投げ
ユーザー tktk_snsntktk_snsn
提出日時 2021-03-16 00:05:23
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 588 bytes
コンパイル時間 289 ms
コンパイル使用メモリ 86,936 KB
実行使用メモリ 139,804 KB
最終ジャッジ日時 2023-08-24 00:21:06
合計ジャッジ時間 10,668 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 215 ms
130,624 KB
testcase_01 AC 283 ms
139,804 KB
testcase_02 AC 123 ms
112,356 KB
testcase_03 AC 123 ms
112,384 KB
testcase_04 AC 123 ms
112,340 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 332 ms
132,324 KB
testcase_17 AC 332 ms
132,908 KB
testcase_18 AC 335 ms
132,748 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 143 ms
111,552 KB
testcase_23 AC 136 ms
111,428 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 145 ms
111,636 KB
testcase_27 AC 138 ms
111,392 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 140 ms
111,492 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 141 ms
111,544 KB
testcase_35 AC 351 ms
132,056 KB
testcase_36 AC 226 ms
129,804 KB
testcase_37 WA -
testcase_38 AC 225 ms
129,780 KB
testcase_39 AC 135 ms
112,960 KB
testcase_40 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 7)


def touch(x, y, xx, yy):
    return (x - xx) ** 2 + (y - yy) ** 2 >= 20 * 20


N = int(input())
XY = tuple(tuple(map(int, input().split())) for _ in range(N))
ans = 0

B = [[set() for _ in range(1001)] for _ in range(1001)]
for i, (x, y) in enumerate(XY):
    xx = x // 100
    yy = y // 100
    ok = True
    for l in range(-1, 2):
        for r in range(-1, 2):
            for xi, yi in B[l][r]:
                ok &= touch(x, y, xi, yi)
    if ok:
        ans += 1
        B[xx][yy].add((x, y))

print(ans)
0