結果

問題 No.202 1円玉投げ
ユーザー noko2250
提出日時 2015-06-06 21:05:52
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 4,927 ms / 5,000 ms
コード長 648 bytes
コンパイル時間 91 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 25,600 KB
最終ジャッジ日時 2024-12-22 09:28:40
合計ジャッジ時間 46,640 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 38
権限があれば一括ダウンロードができます

ソースコード

diff #

'''
Created on 2015/06/06
'''

def check(x, y):
    for dy in range(-1, 2):
        for dx in range(-1, 2):
            bx, by = x // size + dx, y // size + dy
            if 0 <= bx < 20000 // size + 1 and 0 <= by < 20000 //size + 1:
                for cx, cy in L[bx][by]:
                    if (x-cx)**2 + (y-cy)**2 < 400:
                        return False;
    return True;


n = int(input())
size = 140
L = [[[] for i in range(20000 // size + 1)] for j in range(20000 // size + 1)]

ans = 0
for i in range(n):
    x, y = map(int, input().split())
    if check(x, y):
        ans += 1
        L[x//size][y//size].append((x, y))
print(ans)
0