From: 24OI-bot <15963390+24OI-bot@users.noreply.github.com> Date: Tue, 10 Nov 2020 07:14:58 +0000 (-0500) Subject: style: format markdown files with remark-lint X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=c9f2e97034142a598f5dc8cce80dd0bd7f7f2969;p=oi-wiki%2Fmain.git style: format markdown files with remark-lint --- diff --git a/docs/lang/csl/algorithm.md b/docs/lang/csl/algorithm.md index 496feecf..ad30e5a7 100644 --- a/docs/lang/csl/algorithm.md +++ b/docs/lang/csl/algorithm.md @@ -66,12 +66,13 @@ for (unsigned int i = 0; i < dst.size(); i++) cout << dst[i] << " "; int i = lower_bound(a, a + n, x) - a; // 在以下两种情况下,a[i] (a中第一个大于等于x的元素) 即为答案: // 1. a中最小的元素都大于等于x -// 2. a中存在大于等于x的元素,且第一个大于等于x的元素 (a[i]) 相比于第一个小于x的元素 (a[i - 1]) 更接近x -// 否则,a[i - 1] (a中第一个小于x的元素) 即为答案 +// 2. a中存在大于等于x的元素,且第一个大于等于x的元素 (a[i]) +// 相比于第一个小于x的元素 (a[i - 1]) 更接近x 否则,a[i - 1] +// (a中第一个小于x的元素) 即为答案 if (i == 0 || (i < n && a[i] - x < x - a[i - 1])) - cout << a[i]; + cout << a[i]; else - cout << a[i - 1]; + cout << a[i - 1]; ``` - 使用 `sort` 与 `unique` 查找数组 `a` 中 **第 $k$ 大的值** (重复出现的值仅算一次)。