結果

問題 No.202 1円玉投げ
ユーザー しらっ亭しらっ亭
提出日時 2015-06-26 03:12:09
言語 PyPy2
(7.3.15)
結果
WA  
実行時間 -
コード長 673 bytes
コンパイル時間 1,603 ms
コンパイル使用メモリ 77,340 KB
実行使用メモリ 129,932 KB
最終ジャッジ日時 2023-08-23 23:04:36
合計ジャッジ時間 11,289 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 302 ms
129,932 KB
testcase_01 AC 356 ms
128,536 KB
testcase_02 AC 116 ms
101,256 KB
testcase_03 WA -
testcase_04 AC 118 ms
101,184 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 263 ms
128,668 KB
testcase_17 AC 274 ms
129,068 KB
testcase_18 AC 273 ms
128,888 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 124 ms
96,636 KB
testcase_23 AC 126 ms
96,564 KB
testcase_24 AC 123 ms
96,504 KB
testcase_25 AC 126 ms
96,364 KB
testcase_26 AC 122 ms
96,568 KB
testcase_27 AC 125 ms
96,700 KB
testcase_28 AC 117 ms
96,468 KB
testcase_29 AC 122 ms
96,740 KB
testcase_30 AC 128 ms
96,700 KB
testcase_31 AC 122 ms
96,456 KB
testcase_32 AC 126 ms
96,708 KB
testcase_33 WA -
testcase_34 AC 127 ms
96,820 KB
testcase_35 AC 271 ms
128,740 KB
testcase_36 AC 323 ms
128,960 KB
testcase_37 WA -
testcase_38 AC 258 ms
129,060 KB
testcase_39 AC 116 ms
100,704 KB
testcase_40 AC 114 ms
100,312 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][dy].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