Forgot password?
gnaggnoyil
gnaggnoyil

光棍節AC URAL 1111 Square

ID
Date
Author
Problem
Language
Judgement result
Test #
Execution time
Memory used


3967558
19:36:43
11 Nov 2011
gnaggnoyil
1111. Squares
C++
Accepted

0.015
140 KB



題目大意:在R^2上給定n個正方形和一個點P,讓你按照正方形到點P的距離,升序排序Solution:正方形到點P的距離->min(正方形四條邊到點P的距離)

Note:

1.點是否在正方形內:參見USACO計算幾何的講義.

2.點到線段的垂足是否在線段內:注意a*b=|a||b|cosθ

3.注意正方形退化成一個點的情況……