11382 | 2024-08-29 14:07:19 | MCDave | Ludak Harca | cpp17 | Accepted 100/100 | 34ms | 1528 KiB |
#include <iostream>
#include <vector>
using namespace std;
int main()
{
int n, i, x=0, out[6], position, round;
cin >> n;
vector<int> map(n);
for (i = 0; i < n; i++)
{
cin >> map[i];
}
for (i = 0; i < 6; i++)
{
x++, round = 0, position = 0;
while (map[position] != 0)
{
position += map[position];
}
while (position < n)
{
position += x;
round++;
while (position < n && map[position] != 0)
{
position += map[position];
}
}
out[i] = round;
}
for (i = 0; i < 6; i++)
{
cout << out[i] << ' ';
}
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 2ms | 360 KiB | ||||
2 | Accepted | 2ms | 384 KiB | ||||
subtask2 | 25/25 | ||||||
3 | Accepted | 2ms | 256 KiB | ||||
4 | Accepted | 3ms | 360 KiB | ||||
5 | Accepted | 3ms | 360 KiB | ||||
6 | Accepted | 4ms | 488 KiB | ||||
7 | Accepted | 19ms | 1144 KiB | ||||
subtask3 | 40/40 | ||||||
8 | Accepted | 2ms | 360 KiB | ||||
9 | Accepted | 4ms | 360 KiB | ||||
10 | Accepted | 4ms | 396 KiB | ||||
11 | Accepted | 8ms | 488 KiB | ||||
12 | Accepted | 12ms | 748 KiB | ||||
13 | Accepted | 20ms | 920 KiB | ||||
14 | Accepted | 25ms | 1020 KiB | ||||
15 | Accepted | 28ms | 1136 KiB | ||||
subtask4 | 35/35 | ||||||
16 | Accepted | 4ms | 488 KiB | ||||
17 | Accepted | 8ms | 684 KiB | ||||
18 | Accepted | 10ms | 760 KiB | ||||
19 | Accepted | 14ms | 744 KiB | ||||
20 | Accepted | 14ms | 888 KiB | ||||
21 | Accepted | 20ms | 944 KiB | ||||
22 | Accepted | 24ms | 1000 KiB | ||||
23 | Accepted | 27ms | 1148 KiB | ||||
24 | Accepted | 26ms | 1128 KiB | ||||
25 | Accepted | 34ms | 1528 KiB |