1861 | 2022-12-05 19:33:59 | peter | Ludak Harca | cpp17 | Accepted 100/100 | 14ms | 4196 KiB |
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
int main()
{
int n;
scanf("%d", &n);
int* j = (int*)malloc(sizeof(int) * n);
for (int i = 0; i < n; i++)
{
scanf("%d", &j[i]);
}
int dobasok[] = { 0, 0, 0, 0, 0, 0 };
int dobas[] = { 1, 2 ,3 ,4 ,5 ,6 };
int jelenlegi;
for (int i = 0; i < 6; i++)
{
jelenlegi = 0;
while (jelenlegi < n)
{
jelenlegi += dobas[i];
while (jelenlegi < n && j[jelenlegi] != 0)
{
jelenlegi += j[jelenlegi];
}
dobasok[i]++;
}
}
for (int i = 0; i < 6; i++)
{
printf("%d ", dobasok[i]);
}
free(j);
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1360 KiB | ||||
2 | Accepted | 2ms | 1840 KiB | ||||
subtask2 | 25/25 | ||||||
3 | Accepted | 2ms | 1948 KiB | ||||
4 | Accepted | 2ms | 2092 KiB | ||||
5 | Accepted | 2ms | 2132 KiB | ||||
6 | Accepted | 3ms | 2108 KiB | ||||
7 | Accepted | 12ms | 2960 KiB | ||||
subtask3 | 40/40 | ||||||
8 | Accepted | 2ms | 2676 KiB | ||||
9 | Accepted | 2ms | 2784 KiB | ||||
10 | Accepted | 3ms | 2796 KiB | ||||
11 | Accepted | 4ms | 2840 KiB | ||||
12 | Accepted | 7ms | 3008 KiB | ||||
13 | Accepted | 9ms | 3332 KiB | ||||
14 | Accepted | 13ms | 3576 KiB | ||||
15 | Accepted | 14ms | 3840 KiB | ||||
subtask4 | 35/35 | ||||||
16 | Accepted | 3ms | 3572 KiB | ||||
17 | Accepted | 4ms | 3660 KiB | ||||
18 | Accepted | 4ms | 3660 KiB | ||||
19 | Accepted | 7ms | 3732 KiB | ||||
20 | Accepted | 8ms | 4056 KiB | ||||
21 | Accepted | 8ms | 4080 KiB | ||||
22 | Accepted | 9ms | 4052 KiB | ||||
23 | Accepted | 12ms | 4048 KiB | ||||
24 | Accepted | 13ms | 4052 KiB | ||||
25 | Accepted | 14ms | 4196 KiB |