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 <vector>
using namespace std;
int GetBestPosition(int N, int C, int R, int K[], int S[], int E[])
{
vector<int>co[N]={};
for (int i=0;i<C;i++)
{
co[S[i]].push_back(E[i]);
co[E[i]].push_back(S[i]);
}
int ans=0,pos=0;
for (int i=0;i<N;i++)
{
int z=0;
for (auto j:co[i])
{
if (R>K[j-(j>i)])
z++;
else
break;
}
if (z>ans)
{
ans=z;
pos=i;
}
}
return pos;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |