64802023-12-04 15:25:12TDILudak Harcacpp11Time limit exceeded 0/1001.098s4252 KiB
#include <iostream>

using namespace std;

int main()
{
    short int n, a, mesto,b;
    cin>>n;
    short int t[n];
    for (int i=0; i<n; i++)
        cin>>t[i];
    for (int i=1; i<7; i++)
    {
        a=0;
        mesto=0;
        while (mesto<n)
        {
           a++;
           mesto+=i;
           while(mesto<n&&t[mesto]!=0)
                mesto+=t[mesto];
        }
        cout<<a<<" ";
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1748 KiB
2Accepted3ms1992 KiB
subtask20/25
3Accepted3ms2240 KiB
4Accepted3ms2320 KiB
5Accepted3ms2320 KiB
6Accepted4ms2464 KiB
7Time limit exceeded1.098s2724 KiB
subtask30/40
8Accepted3ms2776 KiB
9Accepted3ms2864 KiB
10Accepted4ms2876 KiB
11Accepted7ms3156 KiB
12Time limit exceeded1.069s3480 KiB
13Time limit exceeded1.069s2612 KiB
14Time limit exceeded1.06s3296 KiB
15Time limit exceeded1.07s3624 KiB
subtask40/35
16Accepted4ms3724 KiB
17Accepted7ms3892 KiB
18Accepted10ms3812 KiB
19Time limit exceeded1.085s4044 KiB
20Time limit exceeded1.046s4040 KiB
21Time limit exceeded1.085s4016 KiB
22Time limit exceeded1.062s4080 KiB
23Time limit exceeded1.074s4060 KiB
24Time limit exceeded1.062s4064 KiB
25Time limit exceeded1.077s4252 KiB