60172023-10-22 23:47:17hunortakacsUtazásszervezés (75 pont)cpp17Wrong answer 15/7510ms3544 KiB
#include <iostream>
#include <vector>

using namespace std;

int main()
{
    int N; cin >> N; //vezetok
    int K; cin >> K; //szezon
    int M; cin >> M; //uthossz
    int C; cin >> C; //igenyek

    vector<int> ig(C);
    for(int i=0; i<C; i++) {
        cin >> ig[i]; //novekvo
    }

    int cnt = 0;

    vector<int> utak;
    int prev = 0;
    for(int indul : ig)
    {
        int dt = indul - prev;
        for(int i=0; i<utak.size(); i++)
        {
            utak[i] -= dt;
            if(utak[i] == 0) N++;
        }

        if(N > 0)
        {
            cnt++;
            N--;
            utak.push_back(M);
        }

        prev = indul;
    }

    cout<<cnt<<"";


    return 0;
}
SubtaskSumTestVerdictTimeMemory
base15/75
1Accepted0/03ms1816 KiB
2Wrong answer0/06ms2220 KiB
3Accepted3/32ms2264 KiB
4Accepted4/43ms2480 KiB
5Accepted4/42ms2536 KiB
6Wrong answer0/42ms2740 KiB
7Accepted4/42ms2820 KiB
8Wrong answer0/43ms3068 KiB
9Wrong answer0/53ms3196 KiB
10Wrong answer0/53ms3080 KiB
11Wrong answer0/64ms3152 KiB
12Wrong answer0/64ms3432 KiB
13Wrong answer0/64ms3280 KiB
14Wrong answer0/610ms3300 KiB
15Wrong answer0/66ms3544 KiB
16Wrong answer0/66ms3500 KiB
17Wrong answer0/66ms3500 KiB