6482 | 2023-12-04 15:27:16 | ct72 | Ludak Harca | cpp11 | Accepted 100/100 | 32ms | 5112 KiB |
#include <iostream>
using namespace std;
int main()
{
int n;
cin>>n;
int a[n];
for (int i=0; i<n; i++)
cin>>a[i];
for (int i=1; i<=6; i++)
{
int mezo=0, dobas=0;
while (mezo<n)
{
dobas++;
mezo=mezo+i;
while (mezo<n && a[mezo]!=0)
mezo=mezo+a[mezo];
}
cout<<dobas<<" ";
}
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1876 KiB | ||||
2 | Accepted | 3ms | 2132 KiB | ||||
subtask2 | 25/25 | ||||||
3 | Accepted | 3ms | 2304 KiB | ||||
4 | Accepted | 3ms | 2516 KiB | ||||
5 | Accepted | 3ms | 2728 KiB | ||||
6 | Accepted | 4ms | 2948 KiB | ||||
7 | Accepted | 19ms | 3920 KiB | ||||
subtask3 | 40/40 | ||||||
8 | Accepted | 3ms | 3384 KiB | ||||
9 | Accepted | 3ms | 3460 KiB | ||||
10 | Accepted | 4ms | 3492 KiB | ||||
11 | Accepted | 7ms | 3532 KiB | ||||
12 | Accepted | 12ms | 3704 KiB | ||||
13 | Accepted | 19ms | 4036 KiB | ||||
14 | Accepted | 25ms | 4232 KiB | ||||
15 | Accepted | 28ms | 4456 KiB | ||||
subtask4 | 35/35 | ||||||
16 | Accepted | 4ms | 4056 KiB | ||||
17 | Accepted | 7ms | 4416 KiB | ||||
18 | Accepted | 10ms | 4408 KiB | ||||
19 | Accepted | 14ms | 4516 KiB | ||||
20 | Accepted | 14ms | 4444 KiB | ||||
21 | Accepted | 19ms | 4420 KiB | ||||
22 | Accepted | 23ms | 4588 KiB | ||||
23 | Accepted | 26ms | 4776 KiB | ||||
24 | Accepted | 25ms | 4992 KiB | ||||
25 | Accepted | 32ms | 5112 KiB |