58352023-10-03 17:33:29Vkrisztian01Utazásszervezés (75 pont)cpp11Wrong answer 19/758ms4060 KiB
#include <iostream>
#include<vector>
#include<queue>

using namespace std;

int main()
{
    int n, szezon, hossz, c,db=0;
    cin>>n>>szezon>>hossz>>c;
    priority_queue<pair<int,bool> > seged;
    while(c)
    {
        --c;
        int x;
        cin>>x;
        seged.push(make_pair(-x,false));
    }
    while(!seged.empty())
    {
        if(seged.top().second)
        {
            n++;
            seged.pop();
        }
        else
        {
            if(n>0)
            {
               db++;
               --n;
               seged.push(make_pair(seged.top().first-hossz+1,true));
            }
            seged.pop();
        }

    }
    cout<<db;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base19/75
1Accepted0/03ms1812 KiB
2Wrong answer0/08ms2444 KiB
3Accepted3/33ms2300 KiB
4Accepted4/43ms2520 KiB
5Accepted4/43ms2728 KiB
6Accepted4/43ms2872 KiB
7Accepted4/43ms3080 KiB
8Wrong answer0/43ms3164 KiB
9Wrong answer0/53ms3304 KiB
10Wrong answer0/53ms3400 KiB
11Wrong answer0/64ms3652 KiB
12Wrong answer0/67ms3812 KiB
13Wrong answer0/67ms3820 KiB
14Wrong answer0/68ms3860 KiB
15Wrong answer0/68ms3856 KiB
16Wrong answer0/68ms4060 KiB
17Wrong answer0/68ms4056 KiB