답안 #829469

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
829469 2023-08-18T11:05:43 Z rainboy Airplane (NOI23_airplane) C
22 / 100
22 ms 2948 KB
#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

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]);
      |   ^~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 14 ms 1836 KB Output is correct
3 Correct 17 ms 2312 KB Output is correct
4 Correct 22 ms 2348 KB Output is correct
5 Correct 22 ms 2948 KB Output is correct
6 Correct 17 ms 2848 KB Output is correct
7 Correct 22 ms 2852 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 14 ms 1836 KB Output is correct
3 Correct 17 ms 2312 KB Output is correct
4 Correct 22 ms 2348 KB Output is correct
5 Correct 22 ms 2948 KB Output is correct
6 Correct 17 ms 2848 KB Output is correct
7 Correct 22 ms 2852 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Incorrect 0 ms 212 KB Output isn't correct
11 Halted 0 ms 0 KB -