結果
| 問題 |
No.202 1円玉投げ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-05-04 18:26:36 |
| 言語 | PyPy2 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 653 bytes |
| コンパイル時間 | 2,699 ms |
| コンパイル使用メモリ | 76,368 KB |
| 実行使用メモリ | 201,568 KB |
| 最終ジャッジ日時 | 2024-12-22 08:28:33 |
| 合計ジャッジ時間 | 80,993 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 32 TLE * 6 |
ソースコード
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