제출 #1200698

#제출 시각아이디문제언어결과실행 시간메모리
1200698kadirSequence (APIO23_sequence)C++20
0 / 100
2096 ms6152 KiB
#include<bits/stdc++.h>
#define ull unsigned long long
#define ll long long
#define ff first
#define ss second
#define pb push_back
using namespace std;
const ll mod=1e9+7;
const ll inf=1e18;
const ll mxn=1e6+5;
const ll MAX=1e9+6;
const ll logk=18;
int sequence(int n,vector<int> v) {
	int mx=0;
	for(int i=0; i<n-1; i++) {
		vector<int> v1;
		map<int,int> mp;
		for(int j=i; j<n; j++) {
			v1.pb(v[j]);
			mp[v[j]]++;
			sort(v1.begin(),v1.end());
			if(v1.size()%2) {
				mx=max(mx,mp[v1[v1.size()/2]]);
			} else {
				mx=max({mx,mp[v1.size()/2],mp[v1.size()/2-1]});
			}
		}
	}
	return mx;
}
/*int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int n;
	cin>>n;
	vector<int> v(n);
	for(int i=0; i<n; i++) {
		cin>>v[i];
	}
	int res=sequence(n,v);
	cout<<res<<"\n";
}*/
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...