carnival.cpp: In function 'int ask(std::vector<int>)':
carnival.cpp:11:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
for(int x : v) cout << " " << x; cout << endl;
^~~
carnival.cpp:11:38: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
for(int x : v) cout << " " << x; cout << endl;
^~~~
carnival.cpp: In function 'int main()':
carnival.cpp:21:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if(ask(v) == v.size())
~~~~~~~^~~~~~~~~~~
carnival.cpp:24:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i = 0; i < u.size(); i++)
~~^~~~~~~~~~
carnival.cpp:29:26: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
int mid = lo + hi >> 1;
~~~^~~~
carnival.cpp:33:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if(ask(v) == v.size())
~~~~~~~^~~~~~~~~~~
carnival.cpp:36:25: warning: 'idx' may be used uninitialized in this function [-Wmaybe-uninitialized]
} a[i] = a[u[idx]];
^