1222021-01-16 12:03:42Valaki2Utazásszervezés (75 pont)cpp11Wrong answer 11/756ms4200 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
    int n, k, m, d;
    cin >> n >> k >> m >> d;
    vector<int> v(d);
    for(int i = 0; i < d; ++i) cin >> v[i];
    if(k < m) {cout << "0\n\n";return 0;}
    int vind = 0;
    vector<int> sz(1+n, 0);
    int ans = 0;
    for(int i = 1; i <= k-m+1; ++i) {
        if(vind >= v.size()) {
            break;
        }
        while(v[vind] == i) {
            int szind = 1;
            for(; szind <= n; ++szind) {
                if(sz[szind] <= i) {
                    break;
                }
            }
            if(szind > n) {
                ++vind;
                continue;
            } else {
                ++ans;
                sz[szind] += m;
                ++vind;
                if(vind >= v.size()) {
                    break;
                }
            }
        }

    }
    cout << ans << "\n";
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base11/75
1Accepted0/03ms1812 KiB
2Wrong answer0/06ms2048 KiB
3Accepted3/33ms2108 KiB
4Wrong answer0/43ms2320 KiB
5Accepted4/43ms2532 KiB
6Accepted4/42ms2744 KiB
7Wrong answer0/42ms2820 KiB
8Wrong answer0/42ms2820 KiB
9Wrong answer0/53ms2952 KiB
10Wrong answer0/53ms3172 KiB
11Wrong answer0/64ms3392 KiB
12Wrong answer0/64ms3488 KiB
13Wrong answer0/64ms3620 KiB
14Wrong answer0/66ms3968 KiB
15Wrong answer0/66ms3920 KiB
16Wrong answer0/66ms3924 KiB
17Wrong answer0/66ms4200 KiB