# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
829469 | 2023-08-18T11:05:43 Z | rainboy | Airplane (NOI23_airplane) | C | 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
# | Verdict | Execution time | Memory | 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 |
# | Verdict | Execution time | Memory | 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 | - |
# | Verdict | Execution time | Memory | 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 | - |
# | Verdict | Execution time | Memory | 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 | - |