# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
403935 | Ryednap | Rabbit Carrot (LMIO19_triusis) | C++14 | 1 ms | 204 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"
int main() {
int n, m;
scanf("%d %d", &n, &m);
int answer = 0;
long long prev = 0;
for(int i = 1; i <= n; ++i) {
long long x; scanf("%lld", &x);
if(x > prev + m) x = prev + m, ++answer;
else prev = x + m;
}
printf("%d\n", answer);
return 0;
}
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |