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;
void rec(vector<int> list1, vector<int> list2){
int size1 = (int)list1.size();
if(size1 == 1){
Answer(list1[0], list2[0]);
return;
}
int M = size1/2;
vector<int> list3;
for(int i = 0; i < M; i ++){
list3.push_back(list1[i]);
Query(list1[i]);
}
vector<int> list5;
for(int i = M; i < size1; i ++){
list5.push_back(list1[i]);
}
vector<int> list4;
vector<int> list6;
for(int i = 0; i < size1; i ++){
int temp = Query(list2[i]);
if(temp == M){
list4.push_back(list2[i]);
}else{
list6.push_back(list2[i]);
}
Query(list2[i]);
}
for(int i = 0; i < M; i ++){
Query(list1[i]);
}
rec(list3, list4);
rec(list5, list6);
return;
}
void Solve(int N) {
int curUnique = 0;
vector<int> list1;
vector<int> list2;
for(int i = 1; i <= 2*N; i ++){
int temp = Query(i);
if(temp > curUnique){
list1.push_back(i);
}else{
list2.push_back(i);
}
curUnique = temp;
}
/*
for(int i: list1){
printf("%d\n", i);
}
*/
for(int i = 1; i <= 2*N; i ++){
Query(i);
}
rec(list1, list2);
}
# | 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... |