結果

問題 No.202 1円玉投げ
ユーザー しらっ亭しらっ亭
提出日時 2015-06-26 03:18:51
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 376 ms / 5,000 ms
コード長 681 bytes
コンパイル時間 701 ms
コンパイル使用メモリ 77,860 KB
実行使用メモリ 130,112 KB
最終ジャッジ日時 2023-08-23 23:05:32
合計ジャッジ時間 11,166 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 320 ms
130,112 KB
testcase_01 AC 346 ms
128,628 KB
testcase_02 AC 116 ms
101,236 KB
testcase_03 AC 116 ms
101,236 KB
testcase_04 AC 115 ms
101,268 KB
testcase_05 AC 160 ms
109,700 KB
testcase_06 AC 337 ms
124,808 KB
testcase_07 AC 359 ms
127,660 KB
testcase_08 AC 360 ms
127,768 KB
testcase_09 AC 267 ms
120,148 KB
testcase_10 AC 204 ms
115,092 KB
testcase_11 AC 248 ms
118,736 KB
testcase_12 AC 256 ms
118,284 KB
testcase_13 AC 205 ms
115,136 KB
testcase_14 AC 160 ms
108,500 KB
testcase_15 AC 263 ms
119,908 KB
testcase_16 AC 279 ms
129,972 KB
testcase_17 AC 289 ms
129,716 KB
testcase_18 AC 287 ms
129,648 KB
testcase_19 AC 266 ms
120,060 KB
testcase_20 AC 334 ms
124,656 KB
testcase_21 AC 272 ms
120,064 KB
testcase_22 AC 126 ms
96,484 KB
testcase_23 AC 127 ms
96,552 KB
testcase_24 AC 126 ms
96,384 KB
testcase_25 AC 124 ms
96,540 KB
testcase_26 AC 127 ms
96,616 KB
testcase_27 AC 129 ms
96,516 KB
testcase_28 AC 126 ms
96,776 KB
testcase_29 AC 130 ms
96,924 KB
testcase_30 AC 129 ms
96,692 KB
testcase_31 AC 125 ms
96,616 KB
testcase_32 AC 127 ms
96,904 KB
testcase_33 AC 130 ms
96,804 KB
testcase_34 AC 131 ms
96,804 KB
testcase_35 AC 297 ms
129,816 KB
testcase_36 AC 315 ms
129,552 KB
testcase_37 AC 376 ms
128,024 KB
testcase_38 AC 291 ms
129,836 KB
testcase_39 AC 122 ms
100,644 KB
testcase_40 AC 121 ms
100,900 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

range3 = range(3)

def lap(bin, x, y, dx, dy):
    for xx in range3:
        for yy in range3:
            for bx, by in bin[dx + xx][dy + yy]:
                if (bx - x) ** 2 + (by - y) ** 2 < 400:
                    return True
    bin[dx + 1][dy + 1].append((x, y))
    return False


def solve(XY):
    bin = [[[] for j in range(1003)] for i in range(1003)]

    count = 0
    for x, y in XY:
        dx = x // 20
        dy = y // 20
        if not lap(bin, x, y, dx, dy):
            count += 1

    return count


def main():
    N = int(raw_input())
    XY = [map(int, raw_input().split()) for i in range(N)]

    print(solve(XY))


if __name__ == '__main__':
    main()
0