From c1cc18c1596cd5a444d9f1ee9b761764501b24f1 Mon Sep 17 00:00:00 2001 From: Baoshuo Ren Date: Wed, 1 Dec 2021 20:54:34 +0800 Subject: [PATCH] =?UTF-8?q?#2423.=20=E3=80=8CNOIP2015=E3=80=8D=E8=B7=B3?= =?UTF-8?q?=E7=9F=B3=E5=A4=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://loj.ac/s/1314081 --- LibreOJ/2423/2423.cpp | 37 +++++++++++++++++++++++++++++++++++ LibreOJ/2423/data/stone1.ans | 3 +++ LibreOJ/2423/data/stone1.in | 3 +++ LibreOJ/2423/data/stone10.ans | 3 +++ LibreOJ/2423/data/stone10.in | 3 +++ LibreOJ/2423/data/stone2.ans | 3 +++ LibreOJ/2423/data/stone2.in | 3 +++ LibreOJ/2423/data/stone3.ans | 3 +++ LibreOJ/2423/data/stone3.in | 3 +++ LibreOJ/2423/data/stone4.ans | 3 +++ LibreOJ/2423/data/stone4.in | 3 +++ LibreOJ/2423/data/stone5.ans | 3 +++ LibreOJ/2423/data/stone5.in | 3 +++ LibreOJ/2423/data/stone6.ans | 3 +++ LibreOJ/2423/data/stone6.in | 3 +++ LibreOJ/2423/data/stone7.ans | 3 +++ LibreOJ/2423/data/stone7.in | 3 +++ LibreOJ/2423/data/stone8.ans | 3 +++ LibreOJ/2423/data/stone8.in | 3 +++ LibreOJ/2423/data/stone9.ans | 3 +++ LibreOJ/2423/data/stone9.in | 3 +++ 21 files changed, 97 insertions(+) create mode 100644 LibreOJ/2423/2423.cpp create mode 100644 LibreOJ/2423/data/stone1.ans create mode 100644 LibreOJ/2423/data/stone1.in create mode 100644 LibreOJ/2423/data/stone10.ans create mode 100644 LibreOJ/2423/data/stone10.in create mode 100644 LibreOJ/2423/data/stone2.ans create mode 100644 LibreOJ/2423/data/stone2.in create mode 100644 LibreOJ/2423/data/stone3.ans create mode 100644 LibreOJ/2423/data/stone3.in create mode 100644 LibreOJ/2423/data/stone4.ans create mode 100644 LibreOJ/2423/data/stone4.in create mode 100644 LibreOJ/2423/data/stone5.ans create mode 100644 LibreOJ/2423/data/stone5.in create mode 100644 LibreOJ/2423/data/stone6.ans create mode 100644 LibreOJ/2423/data/stone6.in create mode 100644 LibreOJ/2423/data/stone7.ans create mode 100644 LibreOJ/2423/data/stone7.in create mode 100644 LibreOJ/2423/data/stone8.ans create mode 100644 LibreOJ/2423/data/stone8.in create mode 100644 LibreOJ/2423/data/stone9.ans create mode 100644 LibreOJ/2423/data/stone9.in diff --git a/LibreOJ/2423/2423.cpp b/LibreOJ/2423/2423.cpp new file mode 100644 index 00000000..36b4e792 --- /dev/null +++ b/LibreOJ/2423/2423.cpp @@ -0,0 +1,37 @@ +#include + +using namespace std; + +int n, m, l, r, mid, ans, a[50005]; + +bool check(int x) { + int now = 0, cnt = 0; + for (int i = 1; i <= n; i++) { + if (a[i] - a[now] < x) { + cnt++; + } else { + now = i; + } + } + return cnt <= m; +} + +int main() { + cin >> r >> n >> m; + for (int i = 1; i <= n; i++) { + cin >> a[i]; + } + a[n + 1] = r; + l = 1; + while (l <= r) { + mid = l + r >> 1; + if (check(mid)) { + ans = mid; + l = mid + 1; + } else { + r = mid - 1; + } + } + cout << ans << endl; + return 0; +} diff --git a/LibreOJ/2423/data/stone1.ans b/LibreOJ/2423/data/stone1.ans new file mode 100644 index 00000000..d595cdb8 --- /dev/null +++ b/LibreOJ/2423/data/stone1.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7de1555df0c2700329e815b93b32c571c3ea54dc967b89e81ab73b9972b72d1d +size 2 diff --git a/LibreOJ/2423/data/stone1.in b/LibreOJ/2423/data/stone1.in new file mode 100644 index 00000000..386d8ed3 --- /dev/null +++ b/LibreOJ/2423/data/stone1.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:713fa6511593c7cd8301cd3f27ed72544018b35aee6c90cdb9552fc51827ddfb +size 21 diff --git a/LibreOJ/2423/data/stone10.ans b/LibreOJ/2423/data/stone10.ans new file mode 100644 index 00000000..23d4ecea --- /dev/null +++ b/LibreOJ/2423/data/stone10.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b4e661cf520f58059bffad5ca1f4dc13c9c4884ccc0e2130b9c26bf07930465d +size 5 diff --git a/LibreOJ/2423/data/stone10.in b/LibreOJ/2423/data/stone10.in new file mode 100644 index 00000000..2a63f18c --- /dev/null +++ b/LibreOJ/2423/data/stone10.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c11bed1a8a490220a3b56ff6f05c7a9956d1f82e2a77638e19aac48829963609 +size 489017 diff --git a/LibreOJ/2423/data/stone2.ans b/LibreOJ/2423/data/stone2.ans new file mode 100644 index 00000000..30c8ef68 --- /dev/null +++ b/LibreOJ/2423/data/stone2.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9b74757a5504b7a09e9ad97ec341ee7ed765600267341c67c45b7fbeb402e6eb +size 9 diff --git a/LibreOJ/2423/data/stone2.in b/LibreOJ/2423/data/stone2.in new file mode 100644 index 00000000..b945c835 --- /dev/null +++ b/LibreOJ/2423/data/stone2.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fc5ea2b4fa734ada2bbada42cd7085e6f1b4534a563fb42f4028d14e22da2c1a +size 13 diff --git a/LibreOJ/2423/data/stone3.ans b/LibreOJ/2423/data/stone3.ans new file mode 100644 index 00000000..7032e492 --- /dev/null +++ b/LibreOJ/2423/data/stone3.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c5041f825d84a07b72417b7e45139a068ee38dcdaeecfc57ac25ea76045fe0f4 +size 7 diff --git a/LibreOJ/2423/data/stone3.in b/LibreOJ/2423/data/stone3.in new file mode 100644 index 00000000..588ab38c --- /dev/null +++ b/LibreOJ/2423/data/stone3.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1f97f4bea73b7b7588960550d639426d6a17cc288205bdbcfeaf1a579ef7fba3 +size 870 diff --git a/LibreOJ/2423/data/stone4.ans b/LibreOJ/2423/data/stone4.ans new file mode 100644 index 00000000..4c6f8e25 --- /dev/null +++ b/LibreOJ/2423/data/stone4.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3cd487f345e9c43517366103da017f7a1b4f05a93c00497731d0c053c48552d0 +size 7 diff --git a/LibreOJ/2423/data/stone4.in b/LibreOJ/2423/data/stone4.in new file mode 100644 index 00000000..2a483432 --- /dev/null +++ b/LibreOJ/2423/data/stone4.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0bd9f58520e74df53fcd2f948e72c87895d9ad0c633b5f2049b3c1b6e98d39d9 +size 892 diff --git a/LibreOJ/2423/data/stone5.ans b/LibreOJ/2423/data/stone5.ans new file mode 100644 index 00000000..de0dd2f4 --- /dev/null +++ b/LibreOJ/2423/data/stone5.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:84be431e30a10b7a1e418721898ea78d8e3d617974659946e0fe1204a58e1897 +size 8 diff --git a/LibreOJ/2423/data/stone5.in b/LibreOJ/2423/data/stone5.in new file mode 100644 index 00000000..bb03056d --- /dev/null +++ b/LibreOJ/2423/data/stone5.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b48d64fb44b5ae101c3afd4d3b9072e7e3cf2094f24b9b3479c05db5d143cd75 +size 893 diff --git a/LibreOJ/2423/data/stone6.ans b/LibreOJ/2423/data/stone6.ans new file mode 100644 index 00000000..6df868cd --- /dev/null +++ b/LibreOJ/2423/data/stone6.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f8ffd983bebfc5f722e3cb95be9dd0ea3da02d1c61e5d9b6e041c1996d0366c9 +size 5 diff --git a/LibreOJ/2423/data/stone6.in b/LibreOJ/2423/data/stone6.in new file mode 100644 index 00000000..075ade4a --- /dev/null +++ b/LibreOJ/2423/data/stone6.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:24622862f627b8371f0495b13fc7378fb2fd93cd2baf4d8e7dc9c2df60d3c237 +size 43593 diff --git a/LibreOJ/2423/data/stone7.ans b/LibreOJ/2423/data/stone7.ans new file mode 100644 index 00000000..3eb31b07 --- /dev/null +++ b/LibreOJ/2423/data/stone7.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f53a6829daf602c5828b1645446db8806b9f5377fba827443d2863385fd41ded +size 4 diff --git a/LibreOJ/2423/data/stone7.in b/LibreOJ/2423/data/stone7.in new file mode 100644 index 00000000..298856f5 --- /dev/null +++ b/LibreOJ/2423/data/stone7.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fd94a1eccebfe07a8fd5540d71d358d6b878514264164c500a1ed7a20b0f7476 +size 39167 diff --git a/LibreOJ/2423/data/stone8.ans b/LibreOJ/2423/data/stone8.ans new file mode 100644 index 00000000..d790bd49 --- /dev/null +++ b/LibreOJ/2423/data/stone8.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2e6d31a5983a91251bfae5aefa1c0a19d8ba3cf601d0e8a706b4cfa9661a6b8a +size 2 diff --git a/LibreOJ/2423/data/stone8.in b/LibreOJ/2423/data/stone8.in new file mode 100644 index 00000000..d98b1fcb --- /dev/null +++ b/LibreOJ/2423/data/stone8.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6f05da5e211c6f44ac544cacd7c204e76be0bea868e23e193fb75660cad44b95 +size 388981 diff --git a/LibreOJ/2423/data/stone9.ans b/LibreOJ/2423/data/stone9.ans new file mode 100644 index 00000000..75d6c5fb --- /dev/null +++ b/LibreOJ/2423/data/stone9.ans @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8bb9c6058c5809bdf31da3983edcec45ac7900b0f47c05dd857ef23f3e31cf58 +size 5 diff --git a/LibreOJ/2423/data/stone9.in b/LibreOJ/2423/data/stone9.in new file mode 100644 index 00000000..285a6de5 --- /dev/null +++ b/LibreOJ/2423/data/stone9.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d407fa8e851f2194cd3f5958e6527996bcb2813c68086e6bcac85ece55543fe3 +size 489016