計算幾何 Last Stardust

2021-10-06 20:53:43 字數 2493 閱讀 1962

要ab上側下側分開考慮,否則選到的四元組可能不合法

複習:樹狀陣列求逆序對

int tree[nnn]

;inline

intlowbit

(int x)

inline

void

update

(int i)

}inline

intquery

(int i)

return res;

}

update

(x),ans+

=i-query

(x);

/*or*/

ans+

=i-query

(x)-1,

update

(x);

accode

#include

#define re register

#define in read()

using

namespace std;

inline

int in

const

int nnn=

1e5+10;

const

double eps=

1e-7

;const

double pi=

3.1415

;int n,ans;

struct point

point

(double _x,

double _y)

inline

void

print()

friend

inline point operator+(

const point &u,

const point &v)

friend

inline point operator-(

const point &u,

const point &v)

friend

inline point operator*(

const point &u,

const

double

&v)friend

inline point operator/(

const point &u,

const

double

&v)friend

inline

double

operator^(

const point &u,

const point &v)

friend

inline

double

operator%(

const point &u,

const point &v)

}a,b,p[nnn]

;struct nodenow[nnn]

;int tot;

inline

double

dis(point u,point v)

inline

double

angle

(point u,point v,point w)

inline

bool

cmp1

(const node &u,

const node &v)

inline

bool

cmp2

(const node &u,

const node &v)

inline

bool

c***

(const node &u,

const node &v)

inline

bool

cmp4

(const node &u,

const node &v)

int tree[nnn]

;inline

intlowbit

(int x)

inline

void

update

(int i)

}inline

intquery

(int i)

return res;

}inline

void

upward()

inline

void

downward()

intmain()

計算幾何與計算幾何與

博主這裡曾經學過計算幾何 下文簡稱jj 所以沒有證明或者說明某些演算法,不適合初學者食用 用一道例題及黃學長的 來理解 黃學長 include include include include include include include include include include define...

計算幾何 幾何基礎

這章早在2017年寒假就在培訓的時候由來自清華的hta老師上過了 但是本蒟蒻那時候並不是懂的太多 所以這週ww老師又上了一遍 大概記錄一下 大概就跟高中必修4的平面向量差不多 有上過的應該都會 a x1,y1 b x2,y2 a b x1x2 y1y2 a b a b cos a,b 運用 若a與b...

caioj 計算幾何 面積 計算幾何 叉積

題意 在乙個平面座標系上隨意畫一條有n個點的封閉折線 按畫線的順序給出點的座標 保證封閉折線的任意兩條邊都不相交。最後要計算這條路線包圍的面積。用叉積有關知識解決。重要結論 abs 三點的叉積 2為這三點圍成的三角形的面積。簡要證明 上圖中,黑色的三角形面積為矩形 三個三角形,設數,計算,合併同類項...