# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
584904 | 2022-06-28T06:33:49 Z | 조영욱(#8382) | JOI15_aaqqz (JOI15_aaqqz) | C++14 | 6 ms | 340 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=l;rr<=n;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); } } } for(int i=1;i<=n;i++){ arr[i]=save[i]; } } } printf("%d",ret); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 340 KB | Output is correct |
2 | Correct | 4 ms | 300 KB | Output is correct |
3 | Incorrect | 4 ms | 212 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 340 KB | Output is correct |
2 | Correct | 4 ms | 300 KB | Output is correct |
3 | Incorrect | 4 ms | 212 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |