# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
967654 | 2024-04-22T15:15:21 Z | vjudge1 | Stove (JOI18_stove) | C++17 | 1 ms | 344 KB |
#include <iostream> #include <queue> using namespace std; long long ans = 1ll; int main() { priority_queue<long long> pq; int n, k; long long pre, curr; scanf("%d %d %lld", &n, &k, &pre); for (int i = 1;i < n;i++){ scanf("%lld", &curr); pq.push(curr-pre+1); ans += curr-pre+1; pre = curr; } while (--k){ ans -= pq.top(); pq.pop(); } printf("%lld", ans); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 344 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 344 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 344 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |