# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
912395 | vjudge1 | Rabbit Carrot (LMIO19_triusis) | C++17 | 1 ms | 600 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;
#define int long long
#define x first
#define y second
void solve(){
int last = 0;
int n, x;
cin>>n>>x;
int a[n];
int ans = 0;
for(int i = 0; i < n; i++){
cin>>a[i];
if(a[i] - last <= x){
last = a[i];
}
else{
last = last + x;
ans++;
}
}
cout<<ans<<'\n';
}
main(){
int t = 1;
//cin>>t;
while(t--){
solve();
}
}
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... |