9857 | 2024-03-12 15:52:11 | turitamas | Ludak Harca | cpp17 | Accepted 100/100 | 32ms | 4768 KiB |
#include <iostream>
using namespace std;
int main()
{
int n, a=0, l=1;
cin>>n;
int j[n+1];
for(int i=1; i<=n; i++)
{
cin>>j[i];
}
for(int i=1; i<=6; i++)
{
while(!(l>n))
{
if(j[l]!=0)
{
l+=j[l];
}
else if(j[l]==0)
{
a+=1;
l+=i;
}
}
cout<<a<<" ";
a=0;
l=1;
}
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1884 KiB | ||||
2 | Accepted | 3ms | 2124 KiB | ||||
subtask2 | 25/25 | ||||||
3 | Accepted | 3ms | 2336 KiB | ||||
4 | Accepted | 3ms | 2700 KiB | ||||
5 | Accepted | 3ms | 2636 KiB | ||||
6 | Accepted | 4ms | 2696 KiB | ||||
7 | Accepted | 19ms | 3784 KiB | ||||
subtask3 | 40/40 | ||||||
8 | Accepted | 3ms | 2920 KiB | ||||
9 | Accepted | 3ms | 3000 KiB | ||||
10 | Accepted | 4ms | 3040 KiB | ||||
11 | Accepted | 7ms | 3236 KiB | ||||
12 | Accepted | 13ms | 3516 KiB | ||||
13 | Accepted | 19ms | 3908 KiB | ||||
14 | Accepted | 26ms | 4320 KiB | ||||
15 | Accepted | 28ms | 4644 KiB | ||||
subtask4 | 35/35 | ||||||
16 | Accepted | 4ms | 4252 KiB | ||||
17 | Accepted | 7ms | 4128 KiB | ||||
18 | Accepted | 10ms | 4168 KiB | ||||
19 | Accepted | 14ms | 4332 KiB | ||||
20 | Accepted | 14ms | 4372 KiB | ||||
21 | Accepted | 19ms | 4460 KiB | ||||
22 | Accepted | 23ms | 4576 KiB | ||||
23 | Accepted | 26ms | 4768 KiB | ||||
24 | Accepted | 26ms | 4648 KiB | ||||
25 | Accepted | 32ms | 4736 KiB |