# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
947048 | onepunchac168 | Minerals (JOI19_minerals) | C++14 | 101 ms | 3240 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 "minerals.h"
#include <bits/stdc++.h>
using namespace std;
int query(int x)
{
return Query(x);
}
void solve(vector <int> need,bool check)
{
cerr<<1<<endl;
if (need.size()==2)
{
if (check==1)
{
int aa=query(need[0]);
int bb=query(need[1]);
}
Answer(need[0],need[1]);
return;
}
if (need.size()<=1)
{
assert(1==0);
}
vector <int> aa,bb;
int rr=need.size()/4;
if (check==0)
{
for (int i=0;i<need.size();i++)
{
int a1=query(need[i]);
//cout<<a1<<'\n';
if (a1<=rr)
{
aa.push_back(need[i]);
}
else
{
int a2=query(need[i]);
bb.push_back(need[i]);
}
}
solve(aa,1);
solve(bb,0);
}
else
{
for (int i=rr;i<need.size();i++)
{
int a1=query(need[i]);
}
for (int i=0;i<rr;i++)
{
aa.push_back(need[i]);
}
for (int i=rr;i<need.size();i++)
{
int a1=query(need[i]);
if (a1<=rr)
{
aa.push_back(need[i]);
}
else
{
int a2=query(need[i]);
bb.push_back(need[i]);
}
}
solve(aa,1);
solve(bb,0);
}
}
void Solve(int n)
{
vector <int > opt;
for (int i=1;i<=2*n;i++)
{
opt.push_back(i);
}
solve(opt,0);
}
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... |
# | 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... |