結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,463 ms
112,296 KB
testcase_01 AC 1,562 ms
111,824 KB
testcase_02 AC 495 ms
94,864 KB
testcase_03 AC 489 ms
94,892 KB
testcase_04 AC 493 ms
94,900 KB
testcase_05 AC 545 ms
95,744 KB
testcase_06 AC 1,327 ms
107,344 KB
testcase_07 AC 1,431 ms
108,904 KB
testcase_08 AC 1,434 ms
108,884 KB
testcase_09 AC 1,031 ms
102,952 KB
testcase_10 AC 716 ms
98,572 KB
testcase_11 AC 943 ms
101,520 KB
testcase_12 AC 949 ms
101,880 KB
testcase_13 AC 734 ms
98,800 KB
testcase_14 AC 569 ms
96,072 KB
testcase_15 AC 1,013 ms
102,892 KB
testcase_16 AC 1,392 ms
112,000 KB
testcase_17 AC 1,356 ms
112,064 KB
testcase_18 AC 1,373 ms
111,940 KB
testcase_19 AC 961 ms
102,372 KB
testcase_20 AC 1,313 ms
106,364 KB
testcase_21 AC 997 ms
102,344 KB
testcase_22 AC 504 ms
94,968 KB
testcase_23 AC 496 ms
94,964 KB
testcase_24 AC 500 ms
94,948 KB
testcase_25 AC 489 ms
95,068 KB
testcase_26 AC 495 ms
94,860 KB
testcase_27 AC 488 ms
94,844 KB
testcase_28 AC 488 ms
94,832 KB
testcase_29 AC 478 ms
94,976 KB
testcase_30 AC 480 ms
94,920 KB
testcase_31 AC 479 ms
94,844 KB
testcase_32 AC 485 ms
94,936 KB
testcase_33 AC 486 ms
95,096 KB
testcase_34 AC 486 ms
95,020 KB
testcase_35 AC 1,384 ms
111,976 KB
testcase_36 AC 1,380 ms
112,148 KB
testcase_37 AC 1,472 ms
109,668 KB
testcase_38 AC 1,388 ms
112,152 KB
testcase_39 AC 475 ms
95,020 KB
testcase_40 AC 470 ms
94,900 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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