Submission #1049760

# Submission time Handle Problem Language Result Execution time Memory
1049760 2024-08-09T04:47:03 Z vjudge1 Stove (JOI18_stove) C++17
0 / 100
0 ms 348 KB
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n, k;
    cin >> n >> k;
    vector<int> t(n);
    for (int i = 0; i < n; i++) {
        cin >> t[i];
    }
    vector<int> a;
    for (int i = 0; i < n - 1; i++) {
        a.push_back(t[i+1] - t[i] - 1);
    }
    int ans = n;
    for (int i = 0; i < n - k; i++) {
        ans += a[i];
    }
    cout << ans;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -