6559 | 2023-12-11 00:03:47 | mekkelek | Ludak Harca | cpp17 | Accepted 100/100 | 32ms | 5516 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;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1808 KiB | ||||
2 | Accepted | 3ms | 2316 KiB | ||||
subtask2 | 25/25 | ||||||
3 | Accepted | 3ms | 2304 KiB | ||||
4 | Accepted | 3ms | 2320 KiB | ||||
5 | Accepted | 3ms | 2516 KiB | ||||
6 | Accepted | 4ms | 2728 KiB | ||||
7 | Accepted | 20ms | 3748 KiB | ||||
subtask3 | 40/40 | ||||||
8 | Accepted | 3ms | 2636 KiB | ||||
9 | Accepted | 3ms | 2656 KiB | ||||
10 | Accepted | 4ms | 2724 KiB | ||||
11 | Accepted | 7ms | 3180 KiB | ||||
12 | Accepted | 13ms | 3576 KiB | ||||
13 | Accepted | 19ms | 4300 KiB | ||||
14 | Accepted | 26ms | 4640 KiB | ||||
15 | Accepted | 28ms | 4592 KiB | ||||
subtask4 | 35/35 | ||||||
16 | Accepted | 4ms | 3928 KiB | ||||
17 | Accepted | 7ms | 4228 KiB | ||||
18 | Accepted | 10ms | 4332 KiB | ||||
19 | Accepted | 14ms | 4500 KiB | ||||
20 | Accepted | 14ms | 4644 KiB | ||||
21 | Accepted | 19ms | 4684 KiB | ||||
22 | Accepted | 23ms | 5356 KiB | ||||
23 | Accepted | 26ms | 5440 KiB | ||||
24 | Accepted | 26ms | 5512 KiB | ||||
25 | Accepted | 32ms | 5516 KiB |