結果

問題 No.202 1円玉投げ
ユーザー roiti46roiti46
提出日時 2015-05-04 21:03:37
言語 Python2
(2.7.18)
結果
AC  
実行時間 3,414 ms / 5,000 ms
コード長 708 bytes
コンパイル時間 66 ms
コンパイル使用メモリ 6,720 KB
実行使用メモリ 23,840 KB
最終ジャッジ日時 2023-08-23 22:23:40
合計ジャッジ時間 38,331 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3,414 ms
22,860 KB
testcase_01 AC 1,367 ms
23,840 KB
testcase_02 AC 21 ms
9,172 KB
testcase_03 AC 21 ms
9,160 KB
testcase_04 AC 20 ms
9,224 KB
testcase_05 AC 71 ms
10,360 KB
testcase_06 AC 1,052 ms
20,248 KB
testcase_07 AC 1,213 ms
21,236 KB
testcase_08 AC 1,250 ms
21,428 KB
testcase_09 AC 601 ms
16,836 KB
testcase_10 AC 235 ms
12,724 KB
testcase_11 AC 482 ms
15,672 KB
testcase_12 AC 505 ms
15,908 KB
testcase_13 AC 256 ms
13,028 KB
testcase_14 AC 83 ms
10,460 KB
testcase_15 AC 575 ms
16,504 KB
testcase_16 AC 2,658 ms
22,680 KB
testcase_17 AC 2,675 ms
22,684 KB
testcase_18 AC 2,679 ms
22,760 KB
testcase_19 AC 527 ms
16,064 KB
testcase_20 AC 947 ms
19,292 KB
testcase_21 AC 523 ms
16,176 KB
testcase_22 AC 29 ms
9,432 KB
testcase_23 AC 30 ms
9,348 KB
testcase_24 AC 27 ms
9,160 KB
testcase_25 AC 26 ms
9,072 KB
testcase_26 AC 29 ms
9,444 KB
testcase_27 AC 28 ms
9,360 KB
testcase_28 AC 28 ms
9,220 KB
testcase_29 AC 26 ms
9,160 KB
testcase_30 AC 29 ms
9,524 KB
testcase_31 AC 26 ms
9,188 KB
testcase_32 AC 29 ms
9,444 KB
testcase_33 AC 33 ms
9,496 KB
testcase_34 AC 50 ms
9,424 KB
testcase_35 AC 3,393 ms
22,532 KB
testcase_36 AC 3,405 ms
22,816 KB
testcase_37 AC 1,370 ms
22,000 KB
testcase_38 AC 3,391 ms
22,776 KB
testcase_39 AC 22 ms
9,552 KB
testcase_40 AC 23 ms
9,172 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

size = 100
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