59932023-10-11 20:25:48bodordanielUtazásszervezés (75 pont)cpp11Wrong answer 0/75128ms4724 KiB

#include <bits/stdc++.h>

using namespace std;

int main(){

    int N, K, M, C; cin >> N >> K >> M >> C;
    int elerheto = N;
    int teljesitett = 0;

    int elerhetoseg[N] = {};
    int igenyek[C];

    for (int i=0; i<C; i++) cin >> igenyek[i];


    for (int i=0; i<K; i++){
        for (int ce=0; ce<C; ce++){
            if (igenyek[ce]==i+1 && elerheto){
                elerheto --;
                teljesitett ++;
                for (int x=0; x<N; x++){
                    if (elerhetoseg[x] == 0){
                        elerhetoseg[x] = M;
                        break;
                    }
                }
            }

        }
        for (int x=0; x<N; x++){
                if (elerhetoseg[x] == 1) elerheto++;
                if (elerhetoseg[x]) elerhetoseg[x] --;
                cout << elerhetoseg[x] << " ";
            }
            cout << i << "\n";
    }
    cout << teljesitett;

}
SubtaskSumTestVerdictTimeMemory
base0/75
1Wrong answer0/03ms1876 KiB
2Wrong answer0/0127ms2288 KiB
3Wrong answer0/33ms2340 KiB
4Wrong answer0/43ms2572 KiB
5Wrong answer0/43ms2696 KiB
6Wrong answer0/43ms2940 KiB
7Wrong answer0/42ms3008 KiB
8Wrong answer0/410ms3128 KiB
9Wrong answer0/517ms3624 KiB
10Wrong answer0/528ms3780 KiB
11Wrong answer0/639ms3916 KiB
12Wrong answer0/698ms3924 KiB
13Wrong answer0/697ms3964 KiB
14Wrong answer0/6125ms4012 KiB
15Wrong answer0/6127ms4312 KiB
16Wrong answer0/6127ms4460 KiB
17Wrong answer0/6128ms4724 KiB