답안 #584911

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
584911 2022-06-28T06:39:00 Z 조영욱(#8382) AAQQZ (JOI15_aaqqz) C++14
10 / 100
4000 ms 312 KB
#include <bits/stdc++.h>
using namespace std;

int arr[3001];
int save[3001];

int main(void){
    int n,c;
    scanf("%d %d",&n,&c);
    for(int i=1;i<=n;i++) {
        scanf("%d",&arr[i]);
        save[i]=arr[i];
    }
    int ret=0;
    for(int l=1;l<=n;l++){
        for(int r=l;r<=n;r++) {
            sort(arr+l,arr+r+1);
            for(int ll=1;ll<=n;ll++){
                for(int rr=ll;rr<=n;rr++) {
int save1=ll;
int save2=rr;
                    int val=rr-ll+1;
                    bool flag=true;
                    while (ll<rr) {
                        if (arr[ll]!=arr[rr]) {
                            flag=false;
                            break;
                        }
                        ll++;
                        rr--;
                    }
                    if (flag) {
                        ret=max(ret,val);
                    }
ll=save1;
rr=save2;
                }
            }
            for(int i=1;i<=n;i++){
                arr[i]=save[i];
            }
        }
    }
    printf("%d",ret);
}

Compilation message

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