1860 | 2022-12-05 19:20:26 | peter | Ludak Harca | cpp17 | Runtime error 0/100 | 14ms | 4472 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);
free(dobasok);
free(dobas);
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Runtime error | 3ms | 1556 KiB | ||||
2 | Runtime error | 2ms | 1692 KiB | ||||
subtask2 | 0/25 | ||||||
3 | Runtime error | 2ms | 1884 KiB | ||||
4 | Runtime error | 2ms | 2104 KiB | ||||
5 | Runtime error | 2ms | 2368 KiB | ||||
6 | Runtime error | 3ms | 2448 KiB | ||||
7 | Runtime error | 12ms | 2968 KiB | ||||
subtask3 | 0/40 | ||||||
8 | Runtime error | 2ms | 2920 KiB | ||||
9 | Runtime error | 3ms | 3124 KiB | ||||
10 | Runtime error | 3ms | 3324 KiB | ||||
11 | Runtime error | 4ms | 3428 KiB | ||||
12 | Runtime error | 7ms | 3452 KiB | ||||
13 | Runtime error | 9ms | 3644 KiB | ||||
14 | Runtime error | 13ms | 3712 KiB | ||||
15 | Runtime error | 14ms | 4028 KiB | ||||
subtask4 | 0/35 | ||||||
16 | Runtime error | 4ms | 3988 KiB | ||||
17 | Runtime error | 4ms | 4108 KiB | ||||
18 | Runtime error | 6ms | 4144 KiB | ||||
19 | Runtime error | 7ms | 4120 KiB | ||||
20 | Runtime error | 8ms | 4212 KiB | ||||
21 | Runtime error | 8ms | 4280 KiB | ||||
22 | Runtime error | 10ms | 4332 KiB | ||||
23 | Runtime error | 12ms | 4332 KiB | ||||
24 | Runtime error | 13ms | 4336 KiB | ||||
25 | Runtime error | 14ms | 4472 KiB |