#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define rng(i,x,n) for(int i=x;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define fi first
#define se second
#define pb push_back
#define sz(a) (int)a.size()
#define vec(...) vector<__VA_ARGS__>
#define _3xxEYjy ios::sync_with_stdio(0),cin.tie(0)
typedef long long ll;
using pii=pair<int,int>;
using vi=vector<int>;
void print(){cout<<'\n';}
template<class h,class...t>
void print(const h&v,const t&...u){cout<<v<<' ',print(u...);}
// e
void Solve(int n,int m){
vi ids;
rep(i,n*m){
ids.pb(i+1);
}
vec(vi) pns;
rep(j,n*m){
int l=0,r=sz(ids)-1,c=-1;
while(l<=r){
int mid=(l+r)/2;
vi ask;
rep(i,mid+1){
ask.pb(ids[i]);
}
int res=Query(ask);
if(res>0){
c=mid;
r=mid-1;
}else{
l=mid+1;
}
}
{
int x=ids[c];
ids.erase(ids.begin()+c);
ids.insert(ids.begin(),x);
}
// print(c);
// for(auto x:ids){
// cout<<x<<" ";
// }
// print();
if(j%n==n-1){
pns.pb({});
rep(k,n){
// cout<<ids[0]<<" ";
pns.back().pb(ids[0]);
ids.erase(ids.begin());
}
// cout<<"\n";
}
}
// print("ho",sz(pns));
for(auto vc:pns){
Answer(vc);
}
}
Compilation message
dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:34:12: error: 'Query' was not declared in this scope
34 | int res=Query(ask);
| ^~~~~
dango3.cpp:64:3: error: 'Answer' was not declared in this scope
64 | Answer(vc);
| ^~~~~~