# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
547472 |
2022-04-10T19:58:39 Z |
beaconmc |
Stove (JOI18_stove) |
PyPy 3 |
|
222 ms |
29760 KB |
n,k = map(int, input().split())
sus = []
for i in range(n):
sus.append(int(input()))
sus.sort()
realsus = []
for i in range(len(sus)-1):
realsus.append(sus[i+1] - sus[i])
realsus.sort()
ans = 0
for i in range(n-k):
ans += realsus[i]
ans += k
print(ans)
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
34 ms |
18228 KB |
Output is correct |
2 |
Correct |
43 ms |
18140 KB |
Output is correct |
3 |
Correct |
34 ms |
18256 KB |
Output is correct |
4 |
Correct |
35 ms |
18232 KB |
Output is correct |
5 |
Correct |
34 ms |
18220 KB |
Output is correct |
6 |
Correct |
34 ms |
18200 KB |
Output is correct |
7 |
Correct |
36 ms |
18220 KB |
Output is correct |
8 |
Correct |
35 ms |
18220 KB |
Output is correct |
9 |
Correct |
34 ms |
18220 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
34 ms |
18228 KB |
Output is correct |
2 |
Correct |
43 ms |
18140 KB |
Output is correct |
3 |
Correct |
34 ms |
18256 KB |
Output is correct |
4 |
Correct |
35 ms |
18232 KB |
Output is correct |
5 |
Correct |
34 ms |
18220 KB |
Output is correct |
6 |
Correct |
34 ms |
18200 KB |
Output is correct |
7 |
Correct |
36 ms |
18220 KB |
Output is correct |
8 |
Correct |
35 ms |
18220 KB |
Output is correct |
9 |
Correct |
34 ms |
18220 KB |
Output is correct |
10 |
Correct |
85 ms |
21916 KB |
Output is correct |
11 |
Correct |
82 ms |
21928 KB |
Output is correct |
12 |
Correct |
79 ms |
21880 KB |
Output is correct |
13 |
Correct |
84 ms |
21916 KB |
Output is correct |
14 |
Correct |
87 ms |
21972 KB |
Output is correct |
15 |
Correct |
79 ms |
21824 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
34 ms |
18228 KB |
Output is correct |
2 |
Correct |
43 ms |
18140 KB |
Output is correct |
3 |
Correct |
34 ms |
18256 KB |
Output is correct |
4 |
Correct |
35 ms |
18232 KB |
Output is correct |
5 |
Correct |
34 ms |
18220 KB |
Output is correct |
6 |
Correct |
34 ms |
18200 KB |
Output is correct |
7 |
Correct |
36 ms |
18220 KB |
Output is correct |
8 |
Correct |
35 ms |
18220 KB |
Output is correct |
9 |
Correct |
34 ms |
18220 KB |
Output is correct |
10 |
Correct |
85 ms |
21916 KB |
Output is correct |
11 |
Correct |
82 ms |
21928 KB |
Output is correct |
12 |
Correct |
79 ms |
21880 KB |
Output is correct |
13 |
Correct |
84 ms |
21916 KB |
Output is correct |
14 |
Correct |
87 ms |
21972 KB |
Output is correct |
15 |
Correct |
79 ms |
21824 KB |
Output is correct |
16 |
Correct |
222 ms |
29104 KB |
Output is correct |
17 |
Correct |
208 ms |
29116 KB |
Output is correct |
18 |
Correct |
213 ms |
29072 KB |
Output is correct |
19 |
Correct |
211 ms |
29028 KB |
Output is correct |
20 |
Correct |
212 ms |
29092 KB |
Output is correct |
21 |
Correct |
213 ms |
29372 KB |
Output is correct |
22 |
Correct |
211 ms |
29240 KB |
Output is correct |
23 |
Correct |
205 ms |
29344 KB |
Output is correct |
24 |
Correct |
208 ms |
29760 KB |
Output is correct |