#include "dango3.h"
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimize("Ofast,unroll-loops")
#define pii pair<int,int>
using namespace __gnu_pbds;
using namespace std;
#define pb push_back
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define int long long
#define f first
#define s second
#define pii pair<int,int>
template<class T>bool umax(T &a,T b){if(a<b){a=b;return true;}return false;}
template<class T>bool umin(T &a,T b){if(b<a){a=b;return true;}return false;}
typedef tree<int, null_type, less_equal<int>, rb_tree_tag,
tree_order_statistics_node_update> ordered_set;
const int mod= 1e9 +7;
const int N=1e5*4;
void Solve(int n,int m){
int cnt = m;
while(cnt>0){
int l = 1,r = n*m,ans = 0;
vector<int>vis(n*m+1);
while(l<=r){
int mid = (l+r) >> 1;
vector<int>vs;
for(int i = 1;i<=mid;i++){
if(!vis[i])
vs.pb(i);
}
vector<int>ans1(vs.size());
for(auto &to:vs)ans1.pb(to);
int x = Query(ans1);
if(x>1){
r = mid - 1;
}
else if(x==1){
ans = mid;
break;
}
else l = mid + 1;
}
vector<int>vs;
for(int i = 1;i<=ans;i++){
if(!vis[i])
vs.pb(i);
vis[i] = 1;
}
vector<int>ans(vs.size());
for(auto &to:vs)ans.pb(to);
Answer(to);
}
}
Compilation message
dango3.cpp: In function 'void Solve(long long int, long long int)':
dango3.cpp:43:18: error: invalid initialization of reference of type 'const std::vector<int>&' from expression of type 'std::vector<long long int>'
43 | int x = Query(ans1);
| ^~~~
In file included from dango3.cpp:1:
dango3.h:5:35: note: in passing argument 1 of 'int Query(const std::vector<int>&)'
5 | int Query(const std::vector<int> &x);
| ~~~~~~~~~~~~~~~~~~~~~~~~^
dango3.cpp:63:14: error: conflicting declaration 'std::vector<long long int> ans'
63 | vector<int>ans(vs.size());
| ^~~
dango3.cpp:31:21: note: previous declaration as 'long long int ans'
31 | int l = 1,r = n*m,ans = 0;
| ^~~
dango3.cpp:10:12: error: request for member 'push_back' in 'ans', which is of non-class type 'long long int'
10 | #define pb push_back
| ^~~~~~~~~
dango3.cpp:65:23: note: in expansion of macro 'pb'
65 | for(auto &to:vs)ans.pb(to);
| ^~
dango3.cpp:67:10: error: 'to' was not declared in this scope; did you mean 'tm'?
67 | Answer(to);
| ^~
| tm