#include "ancient2.h"
#include <bits/stdc++.h>
using namespace std;
#define pf printf
#define pb push_back
#define sz(x) ((int)x.size())
string Solve(int N){
int know=0;
string ans="";
while(know!=N){
vector<int> a,b;
for(int i=0;i<know;++i){
a.pb(i+1);
b.pb(i+1);
}
int cur=know,num=1;
while(cur+3*num<=1002&&know!=N){
int ptr=cur+num;
for(int i=cur;i<cur+num;++i){
a.pb(ptr++);
b.pb(ptr++);
}
cur=cur+num;
num*=2;
++know;
}
for(int i=cur;i<cur+num;++i){
a.pb(i),b.pb(i);
}
pf("%d:\n",sz(a));
for(int i:a)pf("%d ",i);pf("\n");
for(int i:b)pf("%d ",i);pf("\n");
int res=Query(sz(a),a,b);
res-=cur;
vector<char> v;
while(num!=1){
v.pb((res&1)+'0');
res>>=1;
num>>=1;
}
while(!v.empty()){
ans.pb(v.back());
pf("add %c\n",v.back());
v.pop_back();
}
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
208 KB |
Wrong Answer [5] |
2 |
Halted |
0 ms |
0 KB |
- |