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>
#define int long long
int32_t main() {
std::ios::sync_with_stdio(0), std::cin.tie(0), std::cout.tie(0);
int N, K; std::cin >> N >> K;
std::vector<int> a(N + 1);
int ans = 0;
for(int i = 1; i <= N; i++){
std::cin >> a[i];
if(a[i - 1] + K < a[i]){
a[i] = a[i - 1] + K;
ans++;
}
}
std::cout << ans << '\n';
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |