結果

問題 No.202 1円玉投げ
ユーザー yuyyuyuyuyyuyu
提出日時 2015-08-08 00:42:31
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 349 ms / 5,000 ms
コード長 663 bytes
コンパイル時間 138 ms
コンパイル使用メモリ 77,796 KB
実行使用メモリ 93,840 KB
最終ジャッジ日時 2023-08-23 23:09:24
合計ジャッジ時間 9,516 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 274 ms
90,460 KB
testcase_01 AC 311 ms
93,840 KB
testcase_02 AC 77 ms
79,632 KB
testcase_03 AC 78 ms
79,400 KB
testcase_04 AC 80 ms
79,620 KB
testcase_05 AC 128 ms
85,092 KB
testcase_06 AC 306 ms
91,736 KB
testcase_07 AC 316 ms
92,144 KB
testcase_08 AC 336 ms
92,132 KB
testcase_09 AC 234 ms
89,304 KB
testcase_10 AC 164 ms
87,044 KB
testcase_11 AC 211 ms
88,592 KB
testcase_12 AC 212 ms
88,752 KB
testcase_13 AC 170 ms
86,728 KB
testcase_14 AC 128 ms
85,140 KB
testcase_15 AC 230 ms
89,332 KB
testcase_16 AC 247 ms
90,552 KB
testcase_17 AC 268 ms
89,884 KB
testcase_18 AC 271 ms
89,944 KB
testcase_19 AC 222 ms
88,788 KB
testcase_20 AC 284 ms
91,032 KB
testcase_21 AC 223 ms
88,724 KB
testcase_22 AC 101 ms
80,320 KB
testcase_23 AC 105 ms
80,132 KB
testcase_24 AC 108 ms
80,308 KB
testcase_25 AC 102 ms
80,256 KB
testcase_26 AC 99 ms
80,160 KB
testcase_27 AC 102 ms
80,196 KB
testcase_28 AC 111 ms
80,172 KB
testcase_29 AC 102 ms
80,164 KB
testcase_30 AC 101 ms
80,260 KB
testcase_31 AC 99 ms
80,256 KB
testcase_32 AC 101 ms
80,016 KB
testcase_33 AC 113 ms
80,072 KB
testcase_34 AC 109 ms
80,092 KB
testcase_35 AC 247 ms
90,092 KB
testcase_36 AC 264 ms
89,608 KB
testcase_37 AC 349 ms
92,520 KB
testcase_38 AC 250 ms
90,064 KB
testcase_39 AC 89 ms
79,704 KB
testcase_40 AC 88 ms
80,096 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

size=50
def dist(ax,ay,bx,by):#distance**2
    return (ax-bx)**2+(ay-by)**2
def check(x,y):#(x,y) intersect some circle?
    for dy in xrange(-1,2):
        for dx in xrange(-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 block[by][bx]:
                    if dist(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 loop 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