Submission #381754

#TimeUsernameProblemLanguageResultExecution timeMemory
381754R3KTRabbit Carrot (LMIO19_triusis)C++17
0 / 100
1 ms364 KiB
#include <iostream> #include <vector> #include <map> #include <cmath> #include <algorithm> #include <deque> #include <queue> #include <stack> #include <set> #include <string> #include <string.h> #include <array> #include <unordered_map> #include <unordered_set> #include <iomanip> using namespace std; typedef long long ll; typedef long double ld; #define pb push_back const int MaxN = 2e5+5; int arr[MaxN]; int n, m; int main() { ios::sync_with_stdio(0); cin.tie(0); cin >> n >> m; for (int i=0; i<n; i++) { cin >> arr[i+1]; } int ans=0; for (int i=1; i<=n; i++) { if (arr[i] - arr[i-1] > m) { ans++; arr[i] = arr[i-1] + m; } } cout << ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...