Submission #127781

# Submission time Handle Problem Language Result Execution time Memory
127781 2019-07-10T06:04:46 Z 송준혁(#3112) JOI15_aaqqz (JOI15_aaqqz) C++14
0 / 100
8 ms 376 KB
#include <bits/stdc++.h>
using namespace std;

int N;
int ans;
int A[110], B[110];

int main(){
    scanf("%d %*d", &N);
    for (int i=1; i<=N; i++) scanf("%d", &A[i]);
    for (int i=1; i<=N; i++) for (int j=i; j<=N; j++){
        for (int k=1; k<=N; k++) B[k] = A[k];
        sort(B+i+1, B+j+1);
        for (int k=1; k<=N; k++) for (int l=k; l<=N; l++){
            bool tf = true;
            for (int x=k; x<=l; x++) if (B[x] != B[l-x+k]){
                tf = false;
                break;
            }
            if (tf) ans = max(ans, l-k+1);
        }
    }
    printf("%d\n", ans);
    return 0;
}

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]
     scanf("%d %*d", &N);
     ~~~~~^~~~~~~~~~~~~~
aaqqz.cpp:10:35: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     for (int i=1; i<=N; i++) scanf("%d", &A[i]);
                              ~~~~~^~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 5 ms 376 KB Output is correct
2 Correct 6 ms 376 KB Output is correct
3 Correct 6 ms 376 KB Output is correct
4 Correct 6 ms 256 KB Output is correct
5 Correct 6 ms 376 KB Output is correct
6 Incorrect 8 ms 376 KB Output isn't correct
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 376 KB Output is correct
2 Correct 6 ms 376 KB Output is correct
3 Correct 6 ms 376 KB Output is correct
4 Correct 6 ms 256 KB Output is correct
5 Correct 6 ms 376 KB Output is correct
6 Incorrect 8 ms 376 KB Output isn't correct
7 Halted 0 ms 0 KB -