답안 #584923

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
584923 2022-06-28T06:49:43 Z 박상훈(#8379) AAQQZ (JOI15_aaqqz) C++14
10 / 100
4000 ms 340 KB
#include <bits/stdc++.h>

typedef long long ll;
using namespace std;
int s[3030], t[3030];

bool ok(int l, int r){
    for (int i=l;i<=r;i++) if (t[i]!=t[r-(i-l)]) return 0;
    return 1;
}

int main(){
    int n, c;
    scanf("%d %d", &n, &c);
    for (int i=1;i<=n;i++) scanf("%d", s+i);

    int ans = 0;
    for (int i=1;i<=n;i++){
        for (int j=i;j<=n;j++){
            for (int k=1;k<=n;k++) t[k] = s[k];
            sort(t+i, t+j+1);
            for (int ii=1;ii<=n;ii++){
                for (int jj=1;jj<=n;jj++) if (ok(ii, jj)) ans = max(ans, jj-ii+1);
            }
        }
    }
    printf("%d\n", ans);
    return 0;
}

Compilation message

aaqqz.cpp: In function 'int main()':
aaqqz.cpp:14:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |     scanf("%d %d", &n, &c);
      |     ~~~~~^~~~~~~~~~~~~~~~~
aaqqz.cpp:15:33: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   15 |     for (int i=1;i<=n;i++) scanf("%d", s+i);
      |                            ~~~~~^~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 212 KB Output is correct
2 Correct 5 ms 212 KB Output is correct
3 Correct 5 ms 212 KB Output is correct
4 Correct 6 ms 300 KB Output is correct
5 Correct 6 ms 300 KB Output is correct
6 Correct 8 ms 304 KB Output is correct
7 Correct 8 ms 296 KB Output is correct
8 Correct 6 ms 212 KB Output is correct
9 Correct 6 ms 304 KB Output is correct
10 Correct 8 ms 300 KB Output is correct
11 Correct 6 ms 212 KB Output is correct
12 Correct 7 ms 212 KB Output is correct
13 Correct 6 ms 212 KB Output is correct
14 Correct 6 ms 308 KB Output is correct
15 Correct 6 ms 304 KB Output is correct
16 Correct 9 ms 304 KB Output is correct
17 Correct 8 ms 212 KB Output is correct
18 Correct 25 ms 212 KB Output is correct
19 Correct 5 ms 212 KB Output is correct
20 Correct 6 ms 308 KB Output is correct
21 Correct 6 ms 212 KB Output is correct
22 Correct 5 ms 212 KB Output is correct
23 Correct 6 ms 300 KB Output is correct
24 Correct 8 ms 340 KB Output is correct
25 Correct 6 ms 212 KB Output is correct
26 Correct 6 ms 304 KB Output is correct
27 Correct 0 ms 212 KB Output is correct
28 Correct 7 ms 304 KB Output is correct
29 Correct 5 ms 212 KB Output is correct
30 Correct 5 ms 212 KB Output is correct
31 Correct 5 ms 212 KB Output is correct
32 Correct 6 ms 212 KB Output is correct
33 Correct 5 ms 212 KB Output is correct
34 Correct 5 ms 212 KB Output is correct
35 Correct 5 ms 212 KB Output is correct
36 Correct 5 ms 212 KB Output is correct
37 Correct 6 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 212 KB Output is correct
2 Correct 5 ms 212 KB Output is correct
3 Correct 5 ms 212 KB Output is correct
4 Correct 6 ms 300 KB Output is correct
5 Correct 6 ms 300 KB Output is correct
6 Correct 8 ms 304 KB Output is correct
7 Correct 8 ms 296 KB Output is correct
8 Correct 6 ms 212 KB Output is correct
9 Correct 6 ms 304 KB Output is correct
10 Correct 8 ms 300 KB Output is correct
11 Correct 6 ms 212 KB Output is correct
12 Correct 7 ms 212 KB Output is correct
13 Correct 6 ms 212 KB Output is correct
14 Correct 6 ms 308 KB Output is correct
15 Correct 6 ms 304 KB Output is correct
16 Correct 9 ms 304 KB Output is correct
17 Correct 8 ms 212 KB Output is correct
18 Correct 25 ms 212 KB Output is correct
19 Correct 5 ms 212 KB Output is correct
20 Correct 6 ms 308 KB Output is correct
21 Correct 6 ms 212 KB Output is correct
22 Correct 5 ms 212 KB Output is correct
23 Correct 6 ms 300 KB Output is correct
24 Correct 8 ms 340 KB Output is correct
25 Correct 6 ms 212 KB Output is correct
26 Correct 6 ms 304 KB Output is correct
27 Correct 0 ms 212 KB Output is correct
28 Correct 7 ms 304 KB Output is correct
29 Correct 5 ms 212 KB Output is correct
30 Correct 5 ms 212 KB Output is correct
31 Correct 5 ms 212 KB Output is correct
32 Correct 6 ms 212 KB Output is correct
33 Correct 5 ms 212 KB Output is correct
34 Correct 5 ms 212 KB Output is correct
35 Correct 5 ms 212 KB Output is correct
36 Correct 5 ms 212 KB Output is correct
37 Correct 6 ms 212 KB Output is correct
38 Execution timed out 4062 ms 212 KB Time limit exceeded
39 Halted 0 ms 0 KB -