carnival.cpp: In function 'int ask(std::vector<int>&, int)':
carnival.cpp:8: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:23:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if(ask(tmp) == tmp.size()) vec = tmp;
~~~~~~~~~^~~~~~~~~~~~~
carnival.cpp:26: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:27:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i = 1; i <= vec.size(); i++) {
~~^~~~~~~~~~~~~
carnival.cpp:29:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int j = 1; j <= vec.size(); j++) if(j != i)
~~^~~~~~~~~~~~~
carnival.cpp:38:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if(ask(v) == vec.size()) r = mid;
~~~~~~~^~~~~~~~~~~~~
carnival.cpp:44: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:11: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:18:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &n);
~~~~~^~~~~~~~~~