# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
604747 | hibiki | The short shank; Redemption (BOI21_prison) | C++11 | 65 ms | 7640 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];
int cur = 0, cnt = 0;
int ans = 0;
priority_queue<int> g;
int main()
{
scanf("%d %d %d", &n, &d, &t);
for(int i = 0; i < n; i++)
{
scanf("%d", &a[i]);
cur++;
if(a[i] <= t)
{
ans++;
ans += cnt;
if(cnt) g.push(cnt);
cur = a[i];
cnt = 0;
}
else if(cur <= t) cnt++;
}
ans += cnt;
if(cnt) g.push(cnt);
cnt = 0;
while(!g.empty() && cnt < d)
{
ans -= g.top();
g.pop();
cnt++;
}
printf("%d\n",ans);
return 0;
}
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... |