# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
971840 | Sunbae | Stove (JOI18_stove) | C++17 | 0 ms | 344 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
signed main(){
int n, k; scanf("%d %d", &n, &k);
int mx = INT_MIN, mn = INT_MAX;
for(int i = 0, x; i<n; ++i){
scanf("%d", &x); mx = max(mx, x); mn = min(mn, x);
}
printf("%d", mx - mn - k + 1);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |