結果

問題 No.202 1円玉投げ
ユーザー noko2250noko2250
提出日時 2015-06-06 21:05:02
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 3,865 ms / 5,000 ms
コード長 790 bytes
コンパイル時間 245 ms
コンパイル使用メモリ 10,988 KB
実行使用メモリ 23,172 KB
最終ジャッジ日時 2023-08-23 23:01:48
合計ジャッジ時間 40,212 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3,865 ms
23,172 KB
testcase_01 AC 1,360 ms
23,104 KB
testcase_02 AC 19 ms
9,728 KB
testcase_03 AC 20 ms
9,636 KB
testcase_04 AC 20 ms
9,520 KB
testcase_05 AC 58 ms
10,684 KB
testcase_06 AC 1,081 ms
19,720 KB
testcase_07 AC 1,264 ms
20,648 KB
testcase_08 AC 1,276 ms
20,856 KB
testcase_09 AC 547 ms
16,276 KB
testcase_10 AC 181 ms
12,692 KB
testcase_11 AC 421 ms
15,120 KB
testcase_12 AC 427 ms
15,388 KB
testcase_13 AC 217 ms
13,100 KB
testcase_14 AC 68 ms
10,780 KB
testcase_15 AC 541 ms
16,236 KB
testcase_16 AC 2,802 ms
22,832 KB
testcase_17 AC 2,823 ms
22,828 KB
testcase_18 AC 2,800 ms
22,880 KB
testcase_19 AC 477 ms
15,720 KB
testcase_20 AC 887 ms
18,908 KB
testcase_21 AC 458 ms
15,796 KB
testcase_22 AC 27 ms
9,900 KB
testcase_23 AC 25 ms
9,892 KB
testcase_24 AC 25 ms
9,708 KB
testcase_25 AC 23 ms
9,692 KB
testcase_26 AC 26 ms
9,860 KB
testcase_27 AC 26 ms
9,824 KB
testcase_28 AC 24 ms
9,692 KB
testcase_29 AC 23 ms
9,708 KB
testcase_30 AC 27 ms
9,832 KB
testcase_31 AC 24 ms
9,580 KB
testcase_32 AC 26 ms
9,952 KB
testcase_33 AC 33 ms
9,664 KB
testcase_34 AC 53 ms
9,816 KB
testcase_35 AC 3,622 ms
22,596 KB
testcase_36 AC 3,851 ms
23,132 KB
testcase_37 AC 1,325 ms
21,548 KB
testcase_38 AC 3,595 ms
23,128 KB
testcase_39 AC 21 ms
9,568 KB
testcase_40 AC 20 ms
9,632 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

'''
Created on 2015/06/06
'''

import math

def main():

    def check(x, y):
        for dy in range(-1, 2):
            for dx in range(-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 L[bx][by]:
                        if (x-cx)**2 + (y-cy)**2 < 400:
                            return False;
        return True;


    n = int(input())
    size = 140
    L = [[[] for i in range(20000 // size + 1)] for j in range(20000 // size + 1)]

    ans = 0
    for i in range(n):
        x, y = map(int, input().split())
        if check(x, y):
            ans += 1
            L[x//size][y//size].append((x, y))
    print(ans)


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