8796 | 2024-01-31 08:43:09 | CWM | Ludak Harca | cpp17 | Accepted 100/100 | 14ms | 4920 KiB |
#include <iostream>
#include <vector>
#include <algorithm>
#include <climits>
#include <queue>
#include <set>
#include <map>
using namespace std;
signed main()
{
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
}
int n;
cin >> n;
vector<int> gates(n);
for (size_t i = 0; i < n; i++)
{
cin >> gates[i];
}
for (size_t i = 1; i <= 6; i++)
{
int cur = 0;
int turns = 0;
while (cur < n) {
cur += i;
while(cur<n && gates[cur]!=0) cur += gates[cur];
turns++;
}
cout << turns << " ";
}
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1976 KiB | ||||
2 | Accepted | 3ms | 2104 KiB | ||||
subtask2 | 25/25 | ||||||
3 | Accepted | 3ms | 2320 KiB | ||||
4 | Accepted | 3ms | 2464 KiB | ||||
5 | Accepted | 3ms | 2556 KiB | ||||
6 | Accepted | 3ms | 2752 KiB | ||||
7 | Accepted | 10ms | 3716 KiB | ||||
subtask3 | 40/40 | ||||||
8 | Accepted | 3ms | 3112 KiB | ||||
9 | Accepted | 3ms | 3104 KiB | ||||
10 | Accepted | 4ms | 3392 KiB | ||||
11 | Accepted | 4ms | 3380 KiB | ||||
12 | Accepted | 7ms | 3476 KiB | ||||
13 | Accepted | 9ms | 3604 KiB | ||||
14 | Accepted | 12ms | 4128 KiB | ||||
15 | Accepted | 13ms | 4472 KiB | ||||
subtask4 | 35/35 | ||||||
16 | Accepted | 4ms | 3912 KiB | ||||
17 | Accepted | 4ms | 4228 KiB | ||||
18 | Accepted | 6ms | 4312 KiB | ||||
19 | Accepted | 7ms | 4252 KiB | ||||
20 | Accepted | 8ms | 4268 KiB | ||||
21 | Accepted | 8ms | 4280 KiB | ||||
22 | Accepted | 10ms | 4252 KiB | ||||
23 | Accepted | 12ms | 4504 KiB | ||||
24 | Accepted | 12ms | 4920 KiB | ||||
25 | Accepted | 14ms | 4848 KiB |