61942023-11-06 15:24:49Balki22Bevásárláscpp11Wrong answer 0/1003ms4396 KiB
#include <iostream>
#include <vector>

using namespace std;

int main()
{
    int n; cin >> n;
    vector<int> kapu(n);
    for (int i = 0; i < n; i++) {
         int k; cin >> k;
         kapu[i] = k;
    }

    vector<int> megoldas(6);
    for (int i = 1; i <= 6; i++) {
        int pos = 0;
        int lepesszam = 0;
        while (pos <= n-1) {
            pos += i;
            while (kapu[pos] > 0) {
                pos += kapu[pos];
                if (pos > n-1) break;
            }
            lepesszam++;
        }
        megoldas[i-1] = lepesszam;
    }
    for (int l : megoldas) {
        cout << l << " ";
    }
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer3ms1964 KiB
2Wrong answer3ms2016 KiB
3Wrong answer3ms2232 KiB
subtask20/10
4Wrong answer3ms2472 KiB
5Wrong answer3ms2592 KiB
6Wrong answer3ms2744 KiB
subtask30/20
7Wrong answer3ms3036 KiB
8Wrong answer3ms3136 KiB
9Wrong answer3ms3216 KiB
10Wrong answer3ms3256 KiB
subtask40/30
11Wrong answer3ms3476 KiB
12Wrong answer3ms3364 KiB
13Wrong answer3ms3564 KiB
14Wrong answer3ms3776 KiB
subtask50/40
15Wrong answer3ms3992 KiB
16Wrong answer3ms4060 KiB
17Wrong answer3ms4296 KiB
18Wrong answer2ms4272 KiB
19Wrong answer2ms4280 KiB
20Wrong answer3ms4396 KiB