Submission #1056925

#TimeUsernameProblemLanguageResultExecution timeMemory
1056925kachim2The short shank; Redemption (BOI21_prison)C++17
0 / 100
0 ms348 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...