結果

問題 No.202 1円玉投げ
ユーザー roiti46roiti46
提出日時 2015-05-04 18:26:36
言語 PyPy2
(7.3.15)
結果
TLE  
実行時間 -
コード長 653 bytes
コンパイル時間 1,394 ms
コンパイル使用メモリ 77,572 KB
実行使用メモリ 101,148 KB
最終ジャッジ日時 2023-08-23 22:22:31
合計ジャッジ時間 24,075 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 AC 3,745 ms
93,796 KB
testcase_02 AC 85 ms
79,484 KB
testcase_03 AC 85 ms
79,316 KB
testcase_04 AC 87 ms
79,676 KB
testcase_05 AC 222 ms
83,852 KB
testcase_06 AC 3,064 ms
90,924 KB
testcase_07 AC 3,857 ms
93,360 KB
testcase_08 AC 4,059 ms
94,920 KB
testcase_09 AC 1,406 ms
90,648 KB
testcase_10 AC 470 ms
86,516 KB
testcase_11 AC 1,035 ms
91,056 KB
testcase_12 AC 1,045 ms
89,840 KB
testcase_13 AC 485 ms
85,860 KB
testcase_14 AC 239 ms
85,520 KB
testcase_15 AC 1,343 ms
89,728 KB
testcase_16 TLE -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

def dist(ax, ay, bx, by):
    return (ax - bx) ** 2 + (ay - by) ** 2
    
N = int(raw_input())
X = [[] for i in xrange(20021)]
Y = [[] for i in xrange(20021)]
ans = 0
for loop in xrange(N):
    x, y = map(int, raw_input().split())
    xcand, ycand = set([]), set([])
    for i in xrange(max(0, x - 20), x + 20):
        for xy in X[i]:
            xcand.add(xy)
    for i in xrange(max(0, y - 20), y + 20):
        for xy in Y[i]:
            ycand.add(xy)
    cand = xcand & ycand
    for cx, cy in cand:
        if dist(x, y, cx, cy) < 400:
            break
    else:
        X[x].append((x, y))
        Y[y].append((x, y))
        ans +=1
print ans
0