My teacher recommended this site called uri, and I am able to solve some questions, but in that I tried all the solutions that the question put and the program I did comes out the results requested in the question, the uri judge is giving 30% of error but I do not know how to correct the error.
Here is my code.
#include <stdio.h>
int main(void)
{
int teste, altura, i, maior;
scanf("%d %d", &altura, &teste);
int vetor[teste], vetorb[teste], vetorc[teste], c = 0, b = 0,
vetorf[teste];
for(i = 0; i < teste; i++)
{
scanf("%d", &vetor[i]);
}
for(i = 0; i < teste; i++)
{
if(i % 2 == 0)
{
vetorc[c++] = vetor[i];
}
else
{
vetorb[b++] = vetor[i];
}
}
for(i = 0; i < c + b; i++)
{
vetorf[i] = vetorb[i] - vetorc[i];
}
maior = vetorf[0];
for(i = 0; i < b; i++)
{
if(vetorf[i] > maior)
{
maior = vetorf[i];
}
}
if(maior > altura)
{
printf("GAME OVER\n");
}
else
{
printf("YOU WIN\n");
}
return 0;
}