OSDN Git Service

style: format markdown files with remark-lint
author24OI-bot <15963390+24OI-bot@users.noreply.github.com>
Tue, 10 Nov 2020 07:14:58 +0000 (02:14 -0500)
committer24OI-bot <15963390+24OI-bot@users.noreply.github.com>
Tue, 10 Nov 2020 07:14:58 +0000 (02:14 -0500)
docs/lang/csl/algorithm.md

index 496feec..ad30e5a 100644 (file)
@@ -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$ 大的值** (重复出现的值仅算一次)。