# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
509808 | leinad2 | Chameleon's Love (JOI20_chameleon) | C++17 | 19 ms | 336 KiB |
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 "chameleon.h"
#include<bits/stdc++.h>
using namespace std;
void Solve(int N)
{
vector<int>v;
for(int i=1;i<=2*N;i++)
{
if(v.size()==0)v.push_back(i);
else
{
int a=0, b=v.size();
while(a<b)
{
int m=a+b>>1;
vector<int>Q;
for(int j=0;j<=m;j++)Q.push_back(v[j]);
Q.push_back(i);
if(Query(Q)==m+1)b=m;
else a=m+1;
}
if(a==v.size())
{
v.push_back(i);
continue;
}
vector<int>V;
for(int j=0;j<a;j++)V.push_back(v[j]);
for(int j=a+1;j<v.size();j++)V.push_back(v[j]);
Answer(v[a], i);
v=V;
}
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |