#include "minerals.h"
#include <bits/stdc++.h>
#define pb push_back
#define l long long
using namespace std;
l lastans = 0;
void rec(vector<l>&v){
if(v.size() == 0){
return;
}
if(v.size() % 2 == 1 ){
cout<<"OPPPSSSS"<<endl;
return;
}
if(v.size() == 2){
Answer(v[0],v[1]);
return;
}
vector<l>v1,v2;
for(int i = 0 ; i < v.size() ; i+=2){
v1.pb(v[i]);
lastans = Query(v[i]);
}
for(int i = 1 ; i < v.size() ; i+=2){
l cnt = lastans;
lastans = Query(v[i]);
if(lastans == cnt){
v1.pb(v[i]);
}
else{
v2.pb(v[i]);
}
lastans = Query(v[i]);
}
for(int i = 0 ; i < v.size() ; i+=2){
lastans = Query(v[i]);
}
rec(v1);
rec(v2);
}
void Solve(int N) {
vector<l>v;
for(int i = 1; i <= 2 * N; i++){
v.pb(i);
}
rec(v);
}
# | 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... |