# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
979042 |
2024-05-10T07:03:03 Z |
pit_smile |
Stove (JOI18_stove) |
C++14 |
|
42 ms |
3596 KB |
#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll in[100005],out[100005],sum=0;
priority_queue<int> keep;
int main()
{
ll guest,open;
cin >> guest >> open;
for(int i=0;i<guest;i++)
{
cin >> in[i];
out[i]=in[i]+1;
}
for(int i=0;i<guest-1;i++)
{
//cout << in[i+1]-out[i] << " ";
keep.push(in[i+1]-out[i]);
}
//cout << out[guest-1] << " " << in[0];
int tungmod=out[guest-1]-in[0];
//cout << tungmod << "\n";
open--;
while(open--)
{
tungmod=tungmod-keep.top();
keep.pop();
}
cout << tungmod;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
440 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
440 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
1 ms |
348 KB |
Output is correct |
11 |
Correct |
1 ms |
348 KB |
Output is correct |
12 |
Correct |
1 ms |
348 KB |
Output is correct |
13 |
Correct |
1 ms |
496 KB |
Output is correct |
14 |
Correct |
2 ms |
348 KB |
Output is correct |
15 |
Correct |
1 ms |
516 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
440 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
1 ms |
348 KB |
Output is correct |
11 |
Correct |
1 ms |
348 KB |
Output is correct |
12 |
Correct |
1 ms |
348 KB |
Output is correct |
13 |
Correct |
1 ms |
496 KB |
Output is correct |
14 |
Correct |
2 ms |
348 KB |
Output is correct |
15 |
Correct |
1 ms |
516 KB |
Output is correct |
16 |
Correct |
29 ms |
3532 KB |
Output is correct |
17 |
Correct |
36 ms |
3508 KB |
Output is correct |
18 |
Correct |
42 ms |
3532 KB |
Output is correct |
19 |
Correct |
30 ms |
3552 KB |
Output is correct |
20 |
Correct |
33 ms |
3584 KB |
Output is correct |
21 |
Correct |
36 ms |
3540 KB |
Output is correct |
22 |
Correct |
41 ms |
3596 KB |
Output is correct |
23 |
Correct |
37 ms |
3536 KB |
Output is correct |
24 |
Correct |
38 ms |
3536 KB |
Output is correct |