# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
71439 | 2018-08-24T16:06:16 Z | win11905 | Stove (JOI18_stove) | C++11 | 38 ms | 10208 KB |
#include <bits/stdc++.h> using namespace std; int n, k; int main() { scanf("%d %d", &n, &k); vector<int> V; int pv; scanf("%d", &pv); for(int i = 1, a; i < n; ++i) { scanf("%d", &a); V.emplace_back(a - pv - 1); pv = a; } sort(V.begin(), V.end()); int v = n-k; for(int i = 0; i < v; ++i) n += V[i]; printf("%d\n", n); }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 3 ms | 548 KB | Output is correct |
4 | Correct | 2 ms | 548 KB | Output is correct |
5 | Correct | 2 ms | 548 KB | Output is correct |
6 | Correct | 3 ms | 548 KB | Output is correct |
7 | Correct | 2 ms | 580 KB | Output is correct |
8 | Correct | 3 ms | 588 KB | Output is correct |
9 | Correct | 2 ms | 736 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 3 ms | 548 KB | Output is correct |
4 | Correct | 2 ms | 548 KB | Output is correct |
5 | Correct | 2 ms | 548 KB | Output is correct |
6 | Correct | 3 ms | 548 KB | Output is correct |
7 | Correct | 2 ms | 580 KB | Output is correct |
8 | Correct | 3 ms | 588 KB | Output is correct |
9 | Correct | 2 ms | 736 KB | Output is correct |
10 | Correct | 5 ms | 752 KB | Output is correct |
11 | Correct | 4 ms | 784 KB | Output is correct |
12 | Correct | 4 ms | 832 KB | Output is correct |
13 | Correct | 3 ms | 864 KB | Output is correct |
14 | Correct | 4 ms | 896 KB | Output is correct |
15 | Correct | 4 ms | 944 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 3 ms | 548 KB | Output is correct |
4 | Correct | 2 ms | 548 KB | Output is correct |
5 | Correct | 2 ms | 548 KB | Output is correct |
6 | Correct | 3 ms | 548 KB | Output is correct |
7 | Correct | 2 ms | 580 KB | Output is correct |
8 | Correct | 3 ms | 588 KB | Output is correct |
9 | Correct | 2 ms | 736 KB | Output is correct |
10 | Correct | 5 ms | 752 KB | Output is correct |
11 | Correct | 4 ms | 784 KB | Output is correct |
12 | Correct | 4 ms | 832 KB | Output is correct |
13 | Correct | 3 ms | 864 KB | Output is correct |
14 | Correct | 4 ms | 896 KB | Output is correct |
15 | Correct | 4 ms | 944 KB | Output is correct |
16 | Correct | 32 ms | 2380 KB | Output is correct |
17 | Correct | 38 ms | 3472 KB | Output is correct |
18 | Correct | 29 ms | 4324 KB | Output is correct |
19 | Correct | 28 ms | 5288 KB | Output is correct |
20 | Correct | 31 ms | 6252 KB | Output is correct |
21 | Correct | 29 ms | 7216 KB | Output is correct |
22 | Correct | 35 ms | 8308 KB | Output is correct |
23 | Correct | 31 ms | 9280 KB | Output is correct |
24 | Correct | 29 ms | 10208 KB | Output is correct |