結果

問題 No.202 1円玉投げ
ユーザー noko2250noko2250
提出日時 2015-06-06 21:03:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 392 ms / 5,000 ms
コード長 805 bytes
コンパイル時間 417 ms
コンパイル使用メモリ 86,900 KB
実行使用メモリ 84,864 KB
最終ジャッジ日時 2023-08-23 22:59:56
合計ジャッジ時間 11,116 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 392 ms
82,036 KB
testcase_01 AC 362 ms
84,864 KB
testcase_02 AC 71 ms
75,120 KB
testcase_03 AC 71 ms
74,940 KB
testcase_04 AC 71 ms
75,304 KB
testcase_05 AC 130 ms
79,088 KB
testcase_06 AC 340 ms
83,572 KB
testcase_07 AC 366 ms
83,816 KB
testcase_08 AC 369 ms
83,900 KB
testcase_09 AC 251 ms
82,368 KB
testcase_10 AC 180 ms
81,052 KB
testcase_11 AC 229 ms
81,924 KB
testcase_12 AC 236 ms
82,064 KB
testcase_13 AC 183 ms
80,708 KB
testcase_14 AC 140 ms
80,036 KB
testcase_15 AC 248 ms
82,164 KB
testcase_16 AC 332 ms
82,164 KB
testcase_17 AC 339 ms
81,908 KB
testcase_18 AC 344 ms
81,872 KB
testcase_19 AC 250 ms
82,180 KB
testcase_20 AC 318 ms
83,140 KB
testcase_21 AC 245 ms
81,984 KB
testcase_22 AC 107 ms
77,828 KB
testcase_23 AC 95 ms
76,732 KB
testcase_24 AC 97 ms
76,304 KB
testcase_25 AC 94 ms
76,332 KB
testcase_26 AC 98 ms
76,768 KB
testcase_27 AC 95 ms
76,260 KB
testcase_28 AC 99 ms
76,584 KB
testcase_29 AC 99 ms
76,572 KB
testcase_30 AC 99 ms
76,344 KB
testcase_31 AC 93 ms
76,428 KB
testcase_32 AC 93 ms
76,608 KB
testcase_33 AC 105 ms
77,824 KB
testcase_34 AC 108 ms
77,576 KB
testcase_35 AC 375 ms
81,692 KB
testcase_36 AC 382 ms
82,968 KB
testcase_37 AC 391 ms
84,056 KB
testcase_38 AC 372 ms
81,748 KB
testcase_39 AC 85 ms
76,400 KB
testcase_40 AC 78 ms
76,092 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

'''
Created on 2015/06/06

@author: kiyo
'''

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