Submission #648186

# Submission time Handle Problem Language Result Execution time Memory
648186 2022-10-05T16:33:33 Z liza Stove (JOI18_stove) C++14
0 / 100
0 ms 212 KB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n, k;
    cin >> n >> k;
    int t[n];
    int a[n];
    cin >> t[0];
    for (int i = 1; i < n; i++)
    {
        cin >> t[i];
        a[i - 1] = t[i] - t[i - 1];
    }
    sort (a, a + n);
    int rez = n;
    for (int i = 0; i < n - k; i++)
    {
        rez = rez - 1 + a[i];
    }
    cout << rez;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -