65592023-12-11 00:03:47mekkelekLudak Harcacpp17Accepted 100/10032ms5516 KiB
#include <iostream>
#include <vector>

using namespace std;

int main() {
    int N;
    cin >> N;
    vector<int> v;
    for (int i{0}; i < N; ++i) {
        int a;
        cin >> a;
        v.push_back(a);
    }
    
    
    
    for (int i{1}; i <= 6; ++i) {
        int a{0};
        int cnt{0};
        while (a < N) {
            ++cnt;
            a += i;
            while (a < N && v[a])
                a += v[a];
        }
        cout << cnt << ' ';
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1808 KiB
2Accepted3ms2316 KiB
subtask225/25
3Accepted3ms2304 KiB
4Accepted3ms2320 KiB
5Accepted3ms2516 KiB
6Accepted4ms2728 KiB
7Accepted20ms3748 KiB
subtask340/40
8Accepted3ms2636 KiB
9Accepted3ms2656 KiB
10Accepted4ms2724 KiB
11Accepted7ms3180 KiB
12Accepted13ms3576 KiB
13Accepted19ms4300 KiB
14Accepted26ms4640 KiB
15Accepted28ms4592 KiB
subtask435/35
16Accepted4ms3928 KiB
17Accepted7ms4228 KiB
18Accepted10ms4332 KiB
19Accepted14ms4500 KiB
20Accepted14ms4644 KiB
21Accepted19ms4684 KiB
22Accepted23ms5356 KiB
23Accepted26ms5440 KiB
24Accepted26ms5512 KiB
25Accepted32ms5516 KiB