結果

問題 No.202 1円玉投げ
ユーザー roiti46roiti46
提出日時 2015-05-04 21:02:56
言語 Python2
(2.7.18)
結果
AC  
実行時間 1,579 ms / 5,000 ms
コード長 707 bytes
コンパイル時間 409 ms
コンパイル使用メモリ 6,728 KB
実行使用メモリ 36,372 KB
最終ジャッジ日時 2023-08-23 22:22:58
合計ジャッジ時間 25,371 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,579 ms
34,060 KB
testcase_01 AC 1,135 ms
36,372 KB
testcase_02 AC 50 ms
20,028 KB
testcase_03 AC 49 ms
20,028 KB
testcase_04 AC 50 ms
20,012 KB
testcase_05 AC 106 ms
20,932 KB
testcase_06 AC 934 ms
32,184 KB
testcase_07 AC 1,042 ms
33,316 KB
testcase_08 AC 1,065 ms
33,388 KB
testcase_09 AC 587 ms
27,884 KB
testcase_10 AC 271 ms
23,352 KB
testcase_11 AC 491 ms
26,624 KB
testcase_12 AC 507 ms
26,912 KB
testcase_13 AC 301 ms
23,844 KB
testcase_14 AC 117 ms
21,220 KB
testcase_15 AC 574 ms
27,732 KB
testcase_16 AC 1,372 ms
34,084 KB
testcase_17 AC 1,344 ms
34,028 KB
testcase_18 AC 1,371 ms
34,056 KB
testcase_19 AC 534 ms
27,324 KB
testcase_20 AC 843 ms
31,032 KB
testcase_21 AC 533 ms
27,212 KB
testcase_22 AC 58 ms
20,076 KB
testcase_23 AC 60 ms
20,156 KB
testcase_24 AC 57 ms
20,024 KB
testcase_25 AC 58 ms
20,016 KB
testcase_26 AC 58 ms
20,008 KB
testcase_27 AC 58 ms
20,024 KB
testcase_28 AC 57 ms
20,004 KB
testcase_29 AC 58 ms
19,976 KB
testcase_30 AC 60 ms
19,952 KB
testcase_31 AC 57 ms
19,972 KB
testcase_32 AC 59 ms
19,964 KB
testcase_33 AC 59 ms
19,884 KB
testcase_34 AC 66 ms
20,140 KB
testcase_35 AC 1,495 ms
33,692 KB
testcase_36 AC 1,527 ms
34,108 KB
testcase_37 AC 1,126 ms
34,228 KB
testcase_38 AC 1,513 ms
34,108 KB
testcase_39 AC 51 ms
20,084 KB
testcase_40 AC 50 ms
19,952 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