結果

問題 No.202 1円玉投げ
ユーザー yuyyuyuyuyyuyu
提出日時 2015-08-07 23:10:35
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 372 ms / 5,000 ms
コード長 622 bytes
コンパイル時間 184 ms
コンパイル使用メモリ 77,644 KB
実行使用メモリ 93,464 KB
最終ジャッジ日時 2023-08-23 23:08:55
合計ジャッジ時間 10,147 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 283 ms
90,532 KB
testcase_01 AC 335 ms
93,464 KB
testcase_02 AC 82 ms
79,464 KB
testcase_03 AC 82 ms
79,460 KB
testcase_04 AC 82 ms
79,680 KB
testcase_05 AC 135 ms
85,248 KB
testcase_06 AC 335 ms
91,840 KB
testcase_07 AC 360 ms
92,196 KB
testcase_08 AC 359 ms
92,084 KB
testcase_09 AC 236 ms
89,396 KB
testcase_10 AC 168 ms
86,540 KB
testcase_11 AC 222 ms
88,736 KB
testcase_12 AC 237 ms
88,808 KB
testcase_13 AC 183 ms
86,684 KB
testcase_14 AC 136 ms
85,164 KB
testcase_15 AC 252 ms
89,476 KB
testcase_16 AC 257 ms
90,620 KB
testcase_17 AC 287 ms
89,904 KB
testcase_18 AC 287 ms
89,928 KB
testcase_19 AC 246 ms
89,060 KB
testcase_20 AC 311 ms
91,100 KB
testcase_21 AC 235 ms
88,672 KB
testcase_22 AC 109 ms
80,000 KB
testcase_23 AC 108 ms
80,208 KB
testcase_24 AC 113 ms
80,136 KB
testcase_25 AC 105 ms
80,256 KB
testcase_26 AC 105 ms
80,536 KB
testcase_27 AC 106 ms
80,268 KB
testcase_28 AC 114 ms
80,408 KB
testcase_29 AC 106 ms
80,060 KB
testcase_30 AC 107 ms
80,192 KB
testcase_31 AC 103 ms
80,192 KB
testcase_32 AC 102 ms
79,936 KB
testcase_33 AC 117 ms
80,304 KB
testcase_34 AC 111 ms
80,268 KB
testcase_35 AC 261 ms
90,144 KB
testcase_36 AC 275 ms
89,344 KB
testcase_37 AC 372 ms
92,608 KB
testcase_38 AC 260 ms
90,064 KB
testcase_39 AC 90 ms
79,820 KB
testcase_40 AC 90 ms
79,828 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

size=50
def dist(ax,ay,bx,by):
    return (ax-bx)**2+(ay-by)**2
def check(x,y):
    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