From 527d060edfc6e6331099b8e4483a4629380775b5 Mon Sep 17 00:00:00 2001 From: qwqbear <41154894+qwqbear@users.noreply.github.com> Date: Sat, 8 Jun 2019 11:42:10 +0800 Subject: [PATCH] =?utf8?q?=E6=9B=B4=E6=96=B0=E4=B8=80=E4=BA=9B=E7=AE=80?= =?utf8?q?=E4=BB=8B=20(#1248)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * 数学部分简介标题重复 * 添加计算几何简介 * Update mkdocs.yml * Update index.md * Update io.md * Update io.md * Update index.md * Update geometry/index.md * Update io.md --- docs/geometry/index.md | 27 +++++++++++++++++++++ docs/math/index.md | 1 - docs/misc/io.md | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++ mkdocs.yml | 2 +- 4 files changed, 92 insertions(+), 2 deletions(-) diff --git a/docs/geometry/index.md b/docs/geometry/index.md index 8b137891..d5b316f0 100644 --- a/docs/geometry/index.md +++ b/docs/geometry/index.md @@ -1 +1,28 @@ +利用计算机建立数学模型解决几何问题。 + +## 种类 + +- 二维计算几何 +- 三维计算几何 + +## 基础 + +首先你要有一点数学几何基础 + +请先阅读 [数学杂项](/math/misc/) 部分。 + +### 以下是你可以在本部分找到的知识(部分未完成,待补充) + +- 二维计算几何基础 +- 三维计算几何基础 +- 有关「距离」的知识 +- Pick 定理 +- 三角剖分 +- 凸包 +- 扫描线 +- 旋转卡壳 +- 半平面交 +- 平面最近点对 +- 随机增量法 + diff --git a/docs/math/index.md b/docs/math/index.md index e515e275..a08af93a 100644 --- a/docs/math/index.md +++ b/docs/math/index.md @@ -1,4 +1,3 @@ -## 数学部分简介 在 OI/ACM 的各种比赛中,常常会有数学题的出现。 diff --git a/docs/misc/io.md b/docs/misc/io.md index b015e1a3..6ddf8483 100644 --- a/docs/misc/io.md +++ b/docs/misc/io.md @@ -209,6 +209,70 @@ template inline T read(){ //声明 template 类,要求提供输入 c = read<__int128>(); ``` +## 完整带调试版 + +```cpp +#define DEBUG 1//调试开关 +namespace IO { +#define isdigit(x) x>='0'&&x<='9' + const int MAXSIZE = 1 << 20; + inline char gc() { +#if DEBUG //调试,可显示字符 + return getchar(); +#endif + static char buf[MAXSIZE],*p1=buf+MAXSIZE,*p2=buf+MAXSIZE; + if(p1==p2) p2=(p1=buf)+fread(buf, 1, MAXSIZE, stdin); + return p1==p2?-1:*p1++; + } + inline bool blank(char ch) { + return ch==' '||ch=='\n'||ch=='\r'||ch=='\t'; + } + template inline void read(T &x) { + register double tmp=1; + register bool sign=0; + x=0; + register char ch=gc(); + for(; !isdigit(ch); ch=gc()) if(ch=='-') sign=1; + for(; isdigit(ch); ch=gc()) x=x*10+ch-'0'; + if(ch=='.') for(ch=gc(); isdigit(ch); ch=gc()) tmp/=10.0, x+=tmp*(ch-48); + if(sign) x=-x; + } + inline void read(char *s) { + register char ch=gc(); + for (; blank(ch); ch=gc()); + for (; !blank(ch); ch=gc()) *s++=ch; + *s=0; + } + inline void read(char &c) { + for (c=gc(); blank(c); c=gc()); + } + inline void push(const char &c) { + char pbuf[MAXSIZE], *pp=pbuf; + if (pp-pbuf==MAXSIZE) fwrite(pbuf, 1, MAXSIZE, stdout), pp=pbuf; + *pp++=c; + } + template inline void write(T x) { + static T sta[35]; + T top=0; + do { + sta[top++]=x%10, x/=10; + } while (x); +#if DEBUG //调试,可显示字符 + while(top) putchar(sta[--top]+'0'); + return; +#endif + while(top) push(sta[--top]+'0'); + } + template inline void write(T x,char lastChar) { + write(x),putchar(lastChar); //打印末尾字符 ex.'\n' + } +} +using namespace IO; +``` + + + + ## 参考 diff --git a/mkdocs.yml b/mkdocs.yml index b3e7ae69..86a3ba1c 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -166,7 +166,7 @@ nav: - 数值积分: math/integral.md - 线性规划: math/linear-programming.md - 博弈论: math/game-theory.md - - 杂项: math/misc.md + - 数学杂项: math/misc.md - 数据结构: - 数据结构部分简介: ds/index.md - STL: -- 2.11.0