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 "Memory2_lib.h"
#include <bits/stdc++.h>
using namespace std;
int n;
void f(vector <int> v){
random_shuffle(v.begin(),v.end());
int j=v[v.size()/2];
vector <int> ve,a[51];
for (int i:v)
if (i!=j)
a[Flip(i,j)].push_back(i);
for (int i=0;i<n;i++){
if (a[i].empty())
continue;
if (a[i].size()<3){
if (a[i].size()==1)
Answer(min(a[i][0],j),max(a[i][0],j),i);
else
Answer(a[i][0],a[i][1],i);
continue;
}
a[i].push_back(j);
f(a[i]);
}
}
void Solve(int T, int N){
vector <int> v;
n=N;
for (int i=0;i<n*2;i++)
v.push_back(i);
f(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... |