# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
127931 | 2019-07-10T08:41:40 Z | 조승현(#3114) | JOI15_aaqqz (JOI15_aaqqz) | C++14 | 4000 ms | 504 KB |
#include<cstdio> #include<algorithm> using namespace std; int w[3010], K, P[3010]; int n, res; int main() { int i, j, k, l; scanf("%d%d", &n, &K); for (i = 1; i <= n; i++) { scanf("%d", &w[i]); } for (i = 1; i <= n; i++) { for (j = i; j <= n; j++) { for (k = 1; k <= n; k++)P[k] = w[k]; sort(P + i, P + j + 1); for (k = 1; k <= n; k++) { for (l = 2; l <= n + n; l++) { int mid1 = l / 2 + 1, mid2 = l - l / 2 - 1; while (P[mid1 - 1] == P[mid2 + 1] && mid1>1 && mid2<n) mid1--, mid2++; res = max(res, mid2 - mid1 + 1); } } } } printf("%d\n", res); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 37 ms | 376 KB | Output is correct |
2 | Correct | 39 ms | 256 KB | Output is correct |
3 | Correct | 38 ms | 256 KB | Output is correct |
4 | Correct | 43 ms | 256 KB | Output is correct |
5 | Correct | 42 ms | 344 KB | Output is correct |
6 | Correct | 47 ms | 376 KB | Output is correct |
7 | Correct | 47 ms | 376 KB | Output is correct |
8 | Correct | 38 ms | 256 KB | Output is correct |
9 | Correct | 38 ms | 504 KB | Output is correct |
10 | Correct | 44 ms | 376 KB | Output is correct |
11 | Correct | 44 ms | 376 KB | Output is correct |
12 | Correct | 40 ms | 376 KB | Output is correct |
13 | Correct | 40 ms | 376 KB | Output is correct |
14 | Correct | 43 ms | 376 KB | Output is correct |
15 | Correct | 42 ms | 256 KB | Output is correct |
16 | Correct | 50 ms | 376 KB | Output is correct |
17 | Correct | 52 ms | 352 KB | Output is correct |
18 | Correct | 188 ms | 376 KB | Output is correct |
19 | Correct | 38 ms | 256 KB | Output is correct |
20 | Correct | 38 ms | 256 KB | Output is correct |
21 | Correct | 44 ms | 376 KB | Output is correct |
22 | Correct | 44 ms | 376 KB | Output is correct |
23 | Correct | 39 ms | 256 KB | Output is correct |
24 | Correct | 39 ms | 376 KB | Output is correct |
25 | Correct | 42 ms | 256 KB | Output is correct |
26 | Correct | 43 ms | 388 KB | Output is correct |
27 | Correct | 2 ms | 376 KB | Output is correct |
28 | Correct | 42 ms | 376 KB | Output is correct |
29 | Correct | 42 ms | 376 KB | Output is correct |
30 | Correct | 43 ms | 256 KB | Output is correct |
31 | Correct | 42 ms | 376 KB | Output is correct |
32 | Correct | 41 ms | 380 KB | Output is correct |
33 | Correct | 45 ms | 376 KB | Output is correct |
34 | Correct | 44 ms | 376 KB | Output is correct |
35 | Correct | 44 ms | 376 KB | Output is correct |
36 | Correct | 43 ms | 256 KB | Output is correct |
37 | Correct | 45 ms | 376 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 37 ms | 376 KB | Output is correct |
2 | Correct | 39 ms | 256 KB | Output is correct |
3 | Correct | 38 ms | 256 KB | Output is correct |
4 | Correct | 43 ms | 256 KB | Output is correct |
5 | Correct | 42 ms | 344 KB | Output is correct |
6 | Correct | 47 ms | 376 KB | Output is correct |
7 | Correct | 47 ms | 376 KB | Output is correct |
8 | Correct | 38 ms | 256 KB | Output is correct |
9 | Correct | 38 ms | 504 KB | Output is correct |
10 | Correct | 44 ms | 376 KB | Output is correct |
11 | Correct | 44 ms | 376 KB | Output is correct |
12 | Correct | 40 ms | 376 KB | Output is correct |
13 | Correct | 40 ms | 376 KB | Output is correct |
14 | Correct | 43 ms | 376 KB | Output is correct |
15 | Correct | 42 ms | 256 KB | Output is correct |
16 | Correct | 50 ms | 376 KB | Output is correct |
17 | Correct | 52 ms | 352 KB | Output is correct |
18 | Correct | 188 ms | 376 KB | Output is correct |
19 | Correct | 38 ms | 256 KB | Output is correct |
20 | Correct | 38 ms | 256 KB | Output is correct |
21 | Correct | 44 ms | 376 KB | Output is correct |
22 | Correct | 44 ms | 376 KB | Output is correct |
23 | Correct | 39 ms | 256 KB | Output is correct |
24 | Correct | 39 ms | 376 KB | Output is correct |
25 | Correct | 42 ms | 256 KB | Output is correct |
26 | Correct | 43 ms | 388 KB | Output is correct |
27 | Correct | 2 ms | 376 KB | Output is correct |
28 | Correct | 42 ms | 376 KB | Output is correct |
29 | Correct | 42 ms | 376 KB | Output is correct |
30 | Correct | 43 ms | 256 KB | Output is correct |
31 | Correct | 42 ms | 376 KB | Output is correct |
32 | Correct | 41 ms | 380 KB | Output is correct |
33 | Correct | 45 ms | 376 KB | Output is correct |
34 | Correct | 44 ms | 376 KB | Output is correct |
35 | Correct | 44 ms | 376 KB | Output is correct |
36 | Correct | 43 ms | 256 KB | Output is correct |
37 | Correct | 45 ms | 376 KB | Output is correct |
38 | Execution timed out | 4091 ms | 256 KB | Time limit exceeded |
39 | Halted | 0 ms | 0 KB | - |