From: 24OI-bot <15963390+24OI-bot@users.noreply.github.com> Date: Fri, 16 Nov 2018 03:57:44 +0000 (+0800) Subject: style: format markdown files with remark-lint X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=dbcb470f625c655f43682d95520631c61bab2018;p=oi-wiki%2Fmain.git style: format markdown files with remark-lint --- diff --git a/docs/intro/common-mistakes.md b/docs/intro/common-mistakes.md index a994ca66..9d0e66e8 100644 --- a/docs/intro/common-mistakes.md +++ b/docs/intro/common-mistakes.md @@ -1,31 +1,36 @@ -本页面主要分享一下在竞赛中经常/很多人会出现的错误。 +本页面主要分享一下在竞赛中经常 / 很多人会出现的错误。 -1. 由于运算符优先级产生的错误 - - `1 << 1+1` : 1左移了2,即该表达式返回的值是 `4` - - 由于宏的展开,且未加括号导致的错误 - ```cpp - #define pwr(x) x*x - pwr(2+2) - ``` - 该宏返回的值并非 $4^2 = 16$ 而是 $2+2\times 2+2 = 8$ - -2. 文件操作有可能会发生的错误 - - 对拍时未清除文件指针即 `fclose(fp)` 就又令 `fp = fopen()`, 这会使得进程出现大量的文件野指针。 - - `freopen()` 中的文件名未加 `.in`/`.out` +1. 由于运算符优先级产生的错误 -3. `int mian()` +- `1 << 1+1` : 1 左移了 2,即该表达式返回的值是 `4` +- 由于宏的展开,且未加括号导致的错误 -4. 无向图边表未开 2 倍 + ```cpp + #define pwr(x) x* x + pwr(2 + 2) + ``` -5. 多组数据未清空数组 + 该宏返回的值并非 $4^2 = 16$ 而是 $2+2\times 2+2 = 8$ -6. 输出`double`要使用`%f`而非`%lf` +2. 文件操作有可能会发生的错误 -7. 分治未判边界导致死递归 +- 对拍时未清除文件指针即 `fclose(fp)` 就又令 `fp = fopen()`, 这会使得进程出现大量的文件野指针。 +- `freopen()` 中的文件名未加 `.in`/`.out` -8. 读入优化未判断负数 +3. `int mian()` -9. `static` 修饰符不会用就瞎用 (血的教训 +4. 无向图边表未开 2 倍 + +5. 多组数据未清空数组 + +6. 输出`double`要使用`%f`而非`%lf` + +7. 分治未判边界导致死递归 + +8. 读入优化未判断负数 + +9. `static` 修饰符不会用就瞎用 (血的教训 + +* * * ---- 未完待续