0w1

Geometry

CFR 1 C. Ancient Berland Circus ( Geometry )

Problem - 1C - Codeforces題意: 有一個正 N 邊形,給你其中三個點,問最小可能面積。制約: 保證最佳的 N 不超過 100。解法: 用餘弦定理求的三個角分別多少。 用正弦定理求外接圓半徑。 枚舉 N,如果三個圓心角都是 360 度 / N 的整數倍,那麼就能直接算…

CFR 613 A. Peter and Snow Blower ( Geometry )

Problem - A - Codeforces題意: 給一個代表自轉中心的座標,以及順時針給的座標描述一個凸多邊形。問旋轉 360 度後,被覆蓋過的面積有多少。資料規模: N ≤ 1e5解法: 顯然要找離圓心的最遠點,以及最近點... 但仔細想想會發現不是最近點,其實是和任意線段…

Yuki 152 貯金箱の消失 ( Triangle, Math )

No.152 貯金箱の消失 - yukicoder 直角三角形の辺はそれぞれ x * x + y * y, x * x - y * y, 2 * x * y と表せる。 総和をとると、2 * x * x + 2 * x * y ≤ L が問題の核心だと分かる。 ここで x, y を枚挙。 #include <bits/stdc++.h> using namespace std; signed main(){</bits/stdc++.h>…

ABC 22 D - Big Bang ( Geometry, Centroid )

http://abc022.contest.atcoder.jp/tasks/abc022_d Problem Statement: Given n ≤ 1e5 points in a 2D plane, it is then rotated, moved by the whole picture, and enlarged p times from its center. Find p. There are a few ways to solve this problem…

Math Vector Template

Haven't yet tested well, might have some bugs. #include <bits/stdc++.h> using namespace std; const double EPS = 1e-10; const double PI = acos( -1.0 ); int dcmp(double x){ if( fabs( x ) < EPS ) return 0; return x < 0 ? -1 : 1; } struct Vector{ double x, y</bits/stdc++.h>…