Submission #829469

#TimeUsernameProblemLanguageResultExecution timeMemory
829469rainboyAirplane (NOI23_airplane)C11
22 / 100
22 ms2948 KiB
#include <stdio.h>

#define N	200000
#define M	400000

int max(int a, int b) { return a > b ? a : b; }

int main() {
	static int aa[N];
	int n, m, i, x, y;

	scanf("%d%d", &n, &m);
	for (i = 0; i < n; i++)
		scanf("%d", &aa[i]);
	x = 0;
	for (i = 0; i < n; i++)
		x = max(x, aa[i] - i);
	y = 0;
	for (i = 0; i < n; i++)
		y = max(y, aa[i] - (n - 1 - i));
	printf("%d\n", n - 1 + x + y);
	return 0;
}

Compilation message (stderr)

Main.c: In function 'main':
Main.c:12:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |  scanf("%d%d", &n, &m);
      |  ^~~~~~~~~~~~~~~~~~~~~
Main.c:14:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |   scanf("%d", &aa[i]);
      |   ^~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...