제출 #1229566

#제출 시각아이디문제언어결과실행 시간메모리
1229566nguRabbit Carrot (LMIO19_triusis)C++20
0 / 100
1 ms332 KiB
#include<bits/stdc++.h> #define int long long #define fi first #define se second using namespace std; int const N = 2e5 + 3, MOD = 1e9 + 7; int n, m, a[N]; signed main() { cin.tie(0)->sync_with_stdio(0); cin >> n >> m; for(int i = 1; i <= n; i++) cin >> a[i]; int cnt = 0; int pre = 0; for (int i = 1; i <= n; ++i) { if (a[i] - pre > m) { cnt++; pre = pre + m; } else pre = a[i]; } cout << cnt; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...