60292023-10-27 20:27:20CzDaniLudak Harcacpp17Accepted 100/10032ms10152 KiB
#include <bits/stdc++.h>
using namespace std;
#define int long long

signed main() {
	int n;
    cin >> n;
    vector<int> v(n+1);
    for(int i = 0; i < n; i++) {
        cin >> v[i];
    }

    int here, ans;
    for(int k = 1; k <= 6; k++) {
        here = 0, ans = 0;
        while(here < n) {
            if (v[here] != 0) {
                here += v[here];
            } else {
                ans++;
                here += k;
            }
        }
        cout << ans << " ";
    }
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1956 KiB
2Accepted3ms2108 KiB
subtask225/25
3Accepted3ms2224 KiB
4Accepted3ms2440 KiB
5Accepted3ms2536 KiB
6Accepted4ms2972 KiB
7Accepted20ms4356 KiB
subtask340/40
8Accepted3ms3088 KiB
9Accepted3ms3368 KiB
10Accepted4ms3660 KiB
11Accepted7ms3968 KiB
12Accepted12ms4268 KiB
13Accepted19ms5348 KiB
14Accepted25ms5952 KiB
15Accepted28ms6420 KiB
subtask435/35
16Accepted4ms5300 KiB
17Accepted7ms5408 KiB
18Accepted10ms5860 KiB
19Accepted14ms6228 KiB
20Accepted14ms6932 KiB
21Accepted19ms7364 KiB
22Accepted23ms7760 KiB
23Accepted26ms8756 KiB
24Accepted25ms9256 KiB
25Accepted32ms10152 KiB