結果

問題 No.202 1円玉投げ
ユーザー yuyyuyuyuyyuyu
提出日時 2015-08-08 00:46:13
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 380 ms / 5,000 ms
コード長 628 bytes
コンパイル時間 136 ms
コンパイル使用メモリ 77,952 KB
実行使用メモリ 93,104 KB
最終ジャッジ日時 2023-08-23 23:09:35
合計ジャッジ時間 10,030 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 284 ms
90,560 KB
testcase_01 AC 341 ms
93,104 KB
testcase_02 AC 81 ms
79,656 KB
testcase_03 AC 81 ms
79,416 KB
testcase_04 AC 84 ms
79,620 KB
testcase_05 AC 132 ms
85,232 KB
testcase_06 AC 337 ms
92,160 KB
testcase_07 AC 350 ms
92,240 KB
testcase_08 AC 355 ms
92,008 KB
testcase_09 AC 260 ms
89,348 KB
testcase_10 AC 175 ms
86,564 KB
testcase_11 AC 232 ms
88,704 KB
testcase_12 AC 237 ms
88,748 KB
testcase_13 AC 181 ms
86,728 KB
testcase_14 AC 133 ms
85,216 KB
testcase_15 AC 250 ms
89,448 KB
testcase_16 AC 289 ms
89,956 KB
testcase_17 AC 261 ms
90,512 KB
testcase_18 AC 267 ms
90,620 KB
testcase_19 AC 235 ms
88,684 KB
testcase_20 AC 316 ms
90,976 KB
testcase_21 AC 244 ms
88,556 KB
testcase_22 AC 110 ms
80,396 KB
testcase_23 AC 106 ms
80,040 KB
testcase_24 AC 116 ms
80,340 KB
testcase_25 AC 105 ms
79,924 KB
testcase_26 AC 108 ms
80,304 KB
testcase_27 AC 113 ms
80,220 KB
testcase_28 AC 111 ms
79,964 KB
testcase_29 AC 109 ms
80,132 KB
testcase_30 AC 107 ms
80,324 KB
testcase_31 AC 100 ms
80,340 KB
testcase_32 AC 100 ms
80,392 KB
testcase_33 AC 113 ms
80,088 KB
testcase_34 AC 117 ms
80,412 KB
testcase_35 AC 270 ms
90,136 KB
testcase_36 AC 270 ms
89,572 KB
testcase_37 AC 380 ms
92,580 KB
testcase_38 AC 264 ms
90,412 KB
testcase_39 AC 89 ms
79,756 KB
testcase_40 AC 90 ms
79,624 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

size=50
def distance(ax,ay,bx,by):
    return (ax-bx)**2+(ay-by)**2
def check(x,y):
    for dx in xrange(-1,2):
        for dy in xrange(-1,2):
            bx,by=x/size+dx,y/size+dy
            if 0<=bx<=20000/size and 0<=by<=20000/size:
                for cx,cy in block[by][bx]:
                    if 0<=distance(x,y,cx,cy)<400:
                        return False
    return True
N=int(raw_input())
block=[[[] for i in xrange(20000/size+1)] for j in xrange(20000/size+1)]
ans=0
for _ in xrange(N):
    x,y=map(int,raw_input().split())
    if check(x,y):
        ans+=1
        block[y/size][x/size].append((x,y))
print ans
0