Submission #1056177

#TimeUsernameProblemLanguageResultExecution timeMemory
1056177Szymon_PilipczukThe short shank; Redemption (BOI21_prison)C++17
0 / 100
0 ms348 KiB
#include <iostream> #include <queue> using namespace std; int main() { int n,d,T; cin>>n>>d>>T; priority_queue <int> m; int t[n]; int time = 0; int rebels = 0; int true_rebels = 0; for(int i = 0;i<n;i++) { cin>>t[i]; } for(int i = 0;i<n;i++) { if(t[i]<=T) { time = max(time-1,T-t[i]); m.push(rebels); true_rebels+=rebels; rebels = 0; true_rebels++; } else if(time>0) { rebels++; } } for(int i = 0;i<d;i++) { if(m.empty() == false) { true_rebels -= m.top(); m.pop(); } } cout<<true_rebels; }
#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...