# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1008935 | PenguinsAreCute | Chameleon's Love (JOI20_chameleon) | C++17 | 9 ms | 476 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;
namespace {
int variable_example = 1;
} // namespace
void Solve(int N) {
int pear[2*N]; fill(pear,pear+2*N,-1);
for(int i=0;i<2*N;i++) if(pear[i]==-1) {
int l = i+1, h = 2*N+1;
while(h-l>1) {
int m=(l+h)/2;
vector<int> v(m-l); iota(v.begin(),v.end(),l+1);
int orig = Query(v);
v.push_back(i+1);
if(Query(v)==orig) h=m;
else l=m;
}
pear[i]=l; pear[l]=i;
}
for(int i=0;i<2*N;i++) if(pear[i]>i) Answer(i+1,1+pear[i]);
}
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... |