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 <bits/stdc++.h>
#include "messy.h"
using namespace std;
string s;
const int c=128;
vector<int> bal;
int n, po;
/*
void add_element(string x) {
cout << x << "\n";
return;
}
void compile_set() {
}
bool check_element(string x) {
cout << x << "\n";
bool f; cin >> f;
return f;
}
*/
vector<int> restore_permutation(int x, int w, int r) {
n=x, po=x;
for (int i=0; i<n; i++) s+='0', bal.push_back(0);
while(po>1) {
for (int i=0; i<n; i+=po) {
int mid=i+po/2;
for (int j=0; j<n; j++) {
s[j]='0';
if (j>=i && j<i+po) s[j]='1';
}
for (int j=i; j<mid; j++) {
s[j]='0';
add_element(s);
s[j]='1';
}
}
po/=2;
}
compile_set(), po=x;
while(po>1) {
for (int i=0; i<n; i+=po) {
for (int j=0; j<n; j++) {
s[j]='0';
if (bal[j]==i) s[j]='1';
}
for (int j=0; j<n; j++) {
if (bal[j]==i) {
s[j]='0';
bool f=check_element(s);
s[j]='1';
if (!f) bal[j]+=po/2;
}
}
}
po/=2;
}
return bal;
}
# | 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... |