This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
int GetBestPosition(int N, int C, int R, int *K, int *S, int *E)
{
int mx=0;
for(int i=0;i<N;++i)
{
vector<int> v;
for(int j=0;j<i;++j)
v.pb(K[j]);
v.pb(R);
for(int j=i;j<N-1;++j)
v.pb(K[j]);
int aa=0;
for(int j=0;j<C;++j)
{
int mx=-1;
for(int k=1;k<=E[j]-S[j]+1;++k)
{
mx=max(mx,v[S[j]]);
v.erase(v.begin()+S[j]);
}
aa+=(mx==R);
v.insert(v.begin()+S[j],mx);
}
mx=max(mx,aa);
}
return mx;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |