結果

問題 No.202 1円玉投げ
コンテスト
ユーザー ayaoni
提出日時 2021-08-30 21:57:24
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 192 ms / 5,000 ms
コード長 1,093 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 138 ms
コンパイル使用メモリ 85,248 KB
実行使用メモリ 113,416 KB
最終ジャッジ日時 2026-05-28 18:44:45
合計ジャッジ時間 5,798 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 38
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def LS2(): return list(sys.stdin.readline().rstrip())


N = I()

area = [[[] for _ in range(801)] for _ in range(801)]
XY = []
R = [-1,0,1]
ans = 0
for k in range(N):
    x,y = MI()
    XY.append((x,y))
    i = x//25
    j = y//25
    is_eliminated = 0
    for di in R:
        ni = i+di
        if not (0 <= ni < 801):
            continue
        for dj in R:
            nj = j+dj
            if not (0 <= nj < 801):
                continue
            for l in area[ni][nj]:
                xl,yl = XY[l]
                if (x-xl)**2+(y-yl)**2 < 400:
                    is_eliminated = 1
                    break
    if is_eliminated:
        continue
    else:
        area[i][j].append(k)
        ans += 1

print(ans)
0