61952023-11-06 15:31:22Balki22Bevásárláscpp17Wrong answer 0/1003ms4200 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 answer3ms1812 KiB
2Wrong answer3ms2056 KiB
3Wrong answer3ms2404 KiB
subtask20/10
4Wrong answer3ms2548 KiB
5Wrong answer3ms2760 KiB
6Wrong answer3ms2920 KiB
subtask30/20
7Wrong answer3ms3112 KiB
8Wrong answer3ms3156 KiB
9Wrong answer3ms3280 KiB
10Wrong answer3ms3536 KiB
subtask40/30
11Wrong answer2ms3604 KiB
12Wrong answer2ms3508 KiB
13Wrong answer3ms3780 KiB
14Wrong answer3ms3908 KiB
subtask50/40
15Wrong answer3ms4148 KiB
16Wrong answer2ms4200 KiB
17Wrong answer3ms4196 KiB
18Wrong answer2ms4196 KiB
19Wrong answer2ms4196 KiB
20Wrong answer2ms4188 KiB