Submission #981918

# Submission time Handle Problem Language Result Execution time Memory
981918 2024-05-13T16:28:04 Z vjudge1 Sequence (APIO23_sequence) C++17
0 / 100
36 ms 4204 KB
#include "sequence.h"
#include <bits/stdc++.h>
#define rep(a,b,c) for(int a=b; a<c; a++)
#define pb push_back

using namespace std;

int sequence(int N, vector<int> A) {
	if(N>100) return 5;
	int ans=0;
	rep(i,0,N){
		rep(j,i,N){
			vector<int> B;
			B=A;
			int c0=0, c1=0;
			rep(k,i,j+1){
				if(B[(j-i)/2]==B[k]) c0++;
				else if(B[(j-i)/2]!=B[(j-i+1)/2] && B[(j-i+1)/2]==B[k]) c1++;
			}
			ans=max(ans,max(c0,c1));
		}
	}
	return ans;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 36 ms 4204 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Incorrect 29 ms 4172 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 36 ms 4188 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -