61962023-11-06 15:32:02Balki22Ludak Harcacpp17Accepted 100/10030ms5500 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
1Accepted3ms1808 KiB
2Accepted3ms2060 KiB
subtask225/25
3Accepted3ms2216 KiB
4Accepted3ms2424 KiB
5Accepted3ms2680 KiB
6Accepted4ms3056 KiB
7Accepted19ms3956 KiB
subtask340/40
8Accepted3ms3212 KiB
9Accepted3ms3260 KiB
10Accepted4ms3632 KiB
11Accepted7ms3996 KiB
12Accepted12ms4060 KiB
13Accepted19ms4144 KiB
14Accepted25ms4332 KiB
15Accepted28ms4600 KiB
subtask435/35
16Accepted4ms4012 KiB
17Accepted7ms4028 KiB
18Accepted10ms4328 KiB
19Accepted13ms4392 KiB
20Accepted14ms4304 KiB
21Accepted18ms4676 KiB
22Accepted21ms4892 KiB
23Accepted25ms5216 KiB
24Accepted25ms5480 KiB
25Accepted30ms5500 KiB