21232022-12-21 08:36:42TimiLudak Harcacpp11Accepted 100/10030ms4956 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;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1872 KiB
2Accepted2ms2068 KiB
subtask225/25
3Accepted2ms2272 KiB
4Accepted2ms2480 KiB
5Accepted2ms2716 KiB
6Accepted4ms2796 KiB
7Accepted18ms3528 KiB
subtask340/40
8Accepted2ms2752 KiB
9Accepted3ms3008 KiB
10Accepted4ms3116 KiB
11Accepted7ms3032 KiB
12Accepted12ms3368 KiB
13Accepted18ms3832 KiB
14Accepted24ms3988 KiB
15Accepted27ms4156 KiB
subtask435/35
16Accepted4ms3696 KiB
17Accepted7ms3916 KiB
18Accepted9ms3896 KiB
19Accepted13ms4060 KiB
20Accepted14ms4348 KiB
21Accepted18ms4444 KiB
22Accepted21ms4652 KiB
23Accepted25ms4764 KiB
24Accepted24ms4788 KiB
25Accepted30ms4956 KiB