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;
int main(){
int n, d, t;
cin >> n >> d >> t;
vector<int> a(n);
for(int i = 0; i < n; i++){
int x;
cin >> x;
a[i] = x;
}
int pans= 0, mcnt = t+3;
for(int i = 0; i < n; i++){
mcnt = min(mcnt, a[i]);
if(mcnt<t){
pans++;
}
mcnt++;
}
int curl = t+3, cnt = 0;
int ans = 0;
for(int i = 0; i < n; i++){
if(a[i]<=t){
curl=a[i];
cnt = 0;
}
else{
if(curl<=t){
cnt++;
ans = max(cnt, ans);
}
}
curl++;
}
cout << pans-ans;
}
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |