6029 | 2023-10-27 20:27:20 | CzDani | Ludak Harca | cpp17 | Accepted 100/100 | 32ms | 10152 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 << " ";
}
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1956 KiB | ||||
2 | Accepted | 3ms | 2108 KiB | ||||
subtask2 | 25/25 | ||||||
3 | Accepted | 3ms | 2224 KiB | ||||
4 | Accepted | 3ms | 2440 KiB | ||||
5 | Accepted | 3ms | 2536 KiB | ||||
6 | Accepted | 4ms | 2972 KiB | ||||
7 | Accepted | 20ms | 4356 KiB | ||||
subtask3 | 40/40 | ||||||
8 | Accepted | 3ms | 3088 KiB | ||||
9 | Accepted | 3ms | 3368 KiB | ||||
10 | Accepted | 4ms | 3660 KiB | ||||
11 | Accepted | 7ms | 3968 KiB | ||||
12 | Accepted | 12ms | 4268 KiB | ||||
13 | Accepted | 19ms | 5348 KiB | ||||
14 | Accepted | 25ms | 5952 KiB | ||||
15 | Accepted | 28ms | 6420 KiB | ||||
subtask4 | 35/35 | ||||||
16 | Accepted | 4ms | 5300 KiB | ||||
17 | Accepted | 7ms | 5408 KiB | ||||
18 | Accepted | 10ms | 5860 KiB | ||||
19 | Accepted | 14ms | 6228 KiB | ||||
20 | Accepted | 14ms | 6932 KiB | ||||
21 | Accepted | 19ms | 7364 KiB | ||||
22 | Accepted | 23ms | 7760 KiB | ||||
23 | Accepted | 26ms | 8756 KiB | ||||
24 | Accepted | 25ms | 9256 KiB | ||||
25 | Accepted | 32ms | 10152 KiB |