이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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 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... |