2123 | 2022-12-21 08:36:42 | Timi | Ludak Harca | cpp11 | Accepted 100/100 | 30ms | 4956 KiB |
#include <iostream>
using namespace std;
int main()
{
int n, i, lepes=0;
cin>>n;
int a[n];
for (i=0; i<n; i++)
{
cin>>a[i];
}
for (int j=1; j<=6; j++)
{
lepes=0;
i=0;
while (i<n)
{
lepes++;
i=i+j;
while ((i<n)&&(a[i]!=0))
i=i+a[i];
}
cout<<lepes<<" ";
}
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1872 KiB | ||||
2 | Accepted | 2ms | 2068 KiB | ||||
subtask2 | 25/25 | ||||||
3 | Accepted | 2ms | 2272 KiB | ||||
4 | Accepted | 2ms | 2480 KiB | ||||
5 | Accepted | 2ms | 2716 KiB | ||||
6 | Accepted | 4ms | 2796 KiB | ||||
7 | Accepted | 18ms | 3528 KiB | ||||
subtask3 | 40/40 | ||||||
8 | Accepted | 2ms | 2752 KiB | ||||
9 | Accepted | 3ms | 3008 KiB | ||||
10 | Accepted | 4ms | 3116 KiB | ||||
11 | Accepted | 7ms | 3032 KiB | ||||
12 | Accepted | 12ms | 3368 KiB | ||||
13 | Accepted | 18ms | 3832 KiB | ||||
14 | Accepted | 24ms | 3988 KiB | ||||
15 | Accepted | 27ms | 4156 KiB | ||||
subtask4 | 35/35 | ||||||
16 | Accepted | 4ms | 3696 KiB | ||||
17 | Accepted | 7ms | 3916 KiB | ||||
18 | Accepted | 9ms | 3896 KiB | ||||
19 | Accepted | 13ms | 4060 KiB | ||||
20 | Accepted | 14ms | 4348 KiB | ||||
21 | Accepted | 18ms | 4444 KiB | ||||
22 | Accepted | 21ms | 4652 KiB | ||||
23 | Accepted | 25ms | 4764 KiB | ||||
24 | Accepted | 24ms | 4788 KiB | ||||
25 | Accepted | 30ms | 4956 KiB |