# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
233612 | 2020-05-21T05:28:20 Z | triple_fault | Stove (JOI18_stove) | C++14 | 30 ms | 3192 KB |
/* fucking change this 2020 */ #include <cstdio> #include <vector> #include <algorithm> #include <cstring> #include <cstdlib> #include <set> #include <map> #include <random> #define ll long long using namespace std; int main(void) { ll n, k; scanf("%lld %lld", &n, &k); ll vals[n]; for (ll i = 0; i < n; ++i) scanf("%lld", &vals[i]); vector<ll> dif; for (ll i = 1; i < n; ++i) dif.push_back(vals[i] - vals[i - 1] - 1); ll ans = n; sort(dif.begin(), dif.end()); for (ll i = 0; i < (n - k); ++i) ans += dif[i]; printf("%lld\n", ans); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 384 KB | Output is correct |
2 | Correct | 4 ms | 384 KB | Output is correct |
3 | Correct | 4 ms | 256 KB | Output is correct |
4 | Correct | 5 ms | 256 KB | Output is correct |
5 | Correct | 5 ms | 384 KB | Output is correct |
6 | Correct | 4 ms | 256 KB | Output is correct |
7 | Correct | 5 ms | 256 KB | Output is correct |
8 | Correct | 5 ms | 256 KB | Output is correct |
9 | Correct | 4 ms | 256 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 384 KB | Output is correct |
2 | Correct | 4 ms | 384 KB | Output is correct |
3 | Correct | 4 ms | 256 KB | Output is correct |
4 | Correct | 5 ms | 256 KB | Output is correct |
5 | Correct | 5 ms | 384 KB | Output is correct |
6 | Correct | 4 ms | 256 KB | Output is correct |
7 | Correct | 5 ms | 256 KB | Output is correct |
8 | Correct | 5 ms | 256 KB | Output is correct |
9 | Correct | 4 ms | 256 KB | Output is correct |
10 | Correct | 5 ms | 384 KB | Output is correct |
11 | Correct | 5 ms | 384 KB | Output is correct |
12 | Correct | 5 ms | 384 KB | Output is correct |
13 | Correct | 5 ms | 384 KB | Output is correct |
14 | Correct | 5 ms | 384 KB | Output is correct |
15 | Correct | 5 ms | 384 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 384 KB | Output is correct |
2 | Correct | 4 ms | 384 KB | Output is correct |
3 | Correct | 4 ms | 256 KB | Output is correct |
4 | Correct | 5 ms | 256 KB | Output is correct |
5 | Correct | 5 ms | 384 KB | Output is correct |
6 | Correct | 4 ms | 256 KB | Output is correct |
7 | Correct | 5 ms | 256 KB | Output is correct |
8 | Correct | 5 ms | 256 KB | Output is correct |
9 | Correct | 4 ms | 256 KB | Output is correct |
10 | Correct | 5 ms | 384 KB | Output is correct |
11 | Correct | 5 ms | 384 KB | Output is correct |
12 | Correct | 5 ms | 384 KB | Output is correct |
13 | Correct | 5 ms | 384 KB | Output is correct |
14 | Correct | 5 ms | 384 KB | Output is correct |
15 | Correct | 5 ms | 384 KB | Output is correct |
16 | Correct | 30 ms | 3192 KB | Output is correct |
17 | Correct | 28 ms | 3192 KB | Output is correct |
18 | Correct | 29 ms | 3192 KB | Output is correct |
19 | Correct | 29 ms | 3064 KB | Output is correct |
20 | Correct | 28 ms | 3192 KB | Output is correct |
21 | Correct | 29 ms | 3192 KB | Output is correct |
22 | Correct | 29 ms | 3192 KB | Output is correct |
23 | Correct | 29 ms | 3192 KB | Output is correct |
24 | Correct | 29 ms | 3192 KB | Output is correct |