mirror of
https://github.com/Oxbian/CodingGame.git
synced 2025-07-07 04:14:27 +02:00
20 lines
389 B
C
20 lines
389 B
C
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <stdbool.h>
|
|
|
|
int main()
|
|
{
|
|
int n, v, max = 0, max_lost =0, curr_lost = 0;
|
|
scanf("%d", &n);
|
|
for (int i = 0; i < n; i++) {
|
|
scanf("%d", &v);
|
|
|
|
curr_lost = v-max;
|
|
if (curr_lost < max_lost) max_lost = curr_lost;
|
|
if (v>max) max = v;
|
|
}
|
|
printf("%d\n",max_lost);
|
|
|
|
return 0;
|
|
} |