carnival.cpp: In function 'int main()':
carnival.cpp:21:30: 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 ",a.size());
~~~~~~~~^
carnival.cpp:18:13: warning: unused variable 'l' [-Wunused-variable]
int l=0;int r=a.size()-1;
^
carnival.cpp:18:21: warning: unused variable 'r' [-Wunused-variable]
int l=0;int r=a.size()-1;
^
carnival.cpp:19:13: warning: unused variable 'mid' [-Wunused-variable]
int mid;
^~~
carnival.cpp:10:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &n);
~~~~~^~~~~~~~~~
carnival.cpp:30:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &c);
~~~~~^~~~~~~~~~
carnival.cpp:56:22: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &nc);
~~~~~^~~~~~~~~~~
carnival.cpp:62:21: warning: 'mid' may be used uninitialized in this function [-Wmaybe-uninitialized]
chk[mid]=c;
~~~~~~~~^~