用户输出
4
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#20756 | #1031. JM的特快列车 | Accepted | 100 | 329 ms | 1156 K | C++ / 916 B | RBQRBQ | 2019-08-02 14:59:20 |
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cmath>
#include <bits/stdc++.h>
#include <algorithm>
#define N 100010
#define INF 0x3f3f3f3f
using namespace std;
typedef long long ll;
#define int ll
int n, c, l, r, mid, st, ed, site[N];
bool ok(int x) {
st = 0;
ed = 0;
for (int i = 0; i < c - 1; i++) {
while (site[ed + 1] - site[st] < x && ed + 1 < n) ed++;
if (ed + 1 == n)
return false;
st = ed + 1;
ed = st;
}
return true;
}
signed main() {
int k;
scanf("%d%d%d", &n, &c, &k);
site[0] = 0;
site[n + 1] = k;
for (int i = 1; i <= n; i++) scanf("%d", &site[i]);
n = n + 2;
c = n - c;
sort(site, site + n);
site[n] = INF;
l = 0;
r = INF;
while (r - l > 1) {
mid = (l + r) / 2;
if (ok(mid))
l = mid;
else
r = mid;
}
printf("%d\n", l);
}
95081 77335 568254347
160731933 121592942 545359032 42372661 94548234 31387055 297203963 120233938
<930969 bytes omitted>
用户输出
25967
系统信息
Exited with return code 0
93202 26371 640243133
544564116 20205828 399307350 600697625 98046473 248585032 150738566 19380659
<915056 bytes omitted>
用户输出
2706
系统信息
Exited with return code 0
98726 15172 4863256
4061736 2523417 2966284 1702310 1537399 4510660 4013440 4354876 2840737 4397394
<767088 bytes omitted>
用户输出
9
系统信息
Exited with return code 0
100000 99862 197697696
189350415 146517714 171890535 104293377 143894247 186136108 163590632 166302
<943029 bytes omitted>
用户输出
1420180
系统信息
Exited with return code 0
100000 142 25917879
25050015 18738442 17905039 7617439 1530367 10773344 8382003 14486136 11569183 2
<856866 bytes omitted>
用户输出
1
系统信息
Exited with return code 0
100000 0 409108430
185938952 21819912 310245988 320735736 37814393 158165858 368886326 407468247 43
<971434 bytes omitted>
用户输出
1
系统信息
Exited with return code 0
100000 100000 595536117
374138900 81845477 282044690 198472228 155427374 591666576 348669485 576466
<979298 bytes omitted>
用户输出
595536117
系统信息
Exited with return code 0
100000 69297 100001
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 3
<588817 bytes omitted>
用户输出
3
系统信息
Exited with return code 0
100000 85178 1000000000
2 4 6 8 9 10 12 14 16 18 19 20 22 23 24 25 27 29 31 32 33 35 36 37 39 41 42
<625941 bytes omitted>
用户输出
9
系统信息
Exited with return code 0
100000 14352 1000000000
1 2 3 5 7 8 10 12 13 15 16 18 20 21 23 25 26 27 29 31 32 33 35 37 38 40 41
<625955 bytes omitted>
用户输出
1
系统信息
Exited with return code 0
100000 99999 100031
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 3
<588817 bytes omitted>
用户输出
50015
系统信息
Exited with return code 0
100000 45195 916842072
4 5 9 11 12 13 14 17 21 25 27 30 34 36 40 42 45 46 49 50 54 57 61 62 64 65 6
<655452 bytes omitted>
用户输出
3
系统信息
Exited with return code 0
100000 2321 623818276
4 7 11 14 16 20 24 28 29 31 33 37 41 44 47 51 52 55 59 63 65 67 68 70 74 76 7
<655432 bytes omitted>
用户输出
1
系统信息
Exited with return code 0
100000 63443 223616492
2 4 6 9 10 14 16 20 23 25 28 29 33 36 38 40 41 42 44 45 49 51 54 58 59 61 64
<655623 bytes omitted>
用户输出
5
系统信息
Exited with return code 0