# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
405945 | Halogen | The short shank; Redemption (BOI21_prison) | C++14 | 77 ms | 3336 KiB |
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 N, D, T;
int A[2000005];
main() {
scanf("%d %d %d", &N, &D, &T);
for (int i = 0; i < N; i++) scanf("%d", &A[i]);
priority_queue<int> pq;
int cur = A[0] > T;
for (int i = 1; i <= N; i++) {
if (A[i] > T) cur++;
else {
pq.push(cur);
cur = 0;
}
}
int ans = 0;
for (int i = 0; i < D; i++) {
ans += pq.top();
pq.pop();
}
printf("%d", N - ans);
}
Compilation message (stderr)
# | 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... |