Submission #490679

#TimeUsernameProblemLanguageResultExecution timeMemory
490679PacifiedPenguinRabbit Carrot (LMIO19_triusis)C++17
0 / 100
1 ms204 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...