carnival.cpp: In function 'int ask(std::vector<int>&, int)':
carnival.cpp:9:27: warning: format '%d' expects argument of type 'int', but argument 2 has type 'std::vector<int>::size_type {aka long unsigned int}' [-Wformat=]
printf("%d ", v.size());
~~~~~~~~^
carnival.cpp: In function 'int main()':
carnival.cpp:24:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if(ask(tmp) == tmp.size()) vec = tmp;
~~~~~~~~~^~~~~~~~~~~~~
carnival.cpp:27:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i = 1; i <= vec.size(); i++) a[vec[i-1]] = i, --cnt;
~~^~~~~~~~~~~~~
carnival.cpp:28:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i = 1; i <= vec.size(); i++) {
~~^~~~~~~~~~~~~
carnival.cpp:30:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int j = 1; j <= vec.size(); j++) if(j != i)
~~^~~~~~~~~~~~~
carnival.cpp:39:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if(ask(v) == vec.size()) r = mid;
~~~~~~~^~~~~~~~~~~~~
carnival.cpp:45:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if(ask(v) == vec.size()) a[r] = i, --cnt;
~~~~~~~^~~~~~~~~~~~~
carnival.cpp: In function 'int ask(std::vector<int>&, int)':
carnival.cpp:12:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &ret);
~~~~~^~~~~~~~~~~~
carnival.cpp: In function 'int main()':
carnival.cpp:19:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &n);
~~~~~^~~~~~~~~~