foo.cc: In function 'int main()':
foo.cc:48:11: warning: format '%d' expects argument of type 'int', but argument 2 has type 'std::__iterator_traits<__gnu_cxx::__normal_iterator<int*, std::vector<int> >, void>::difference_type' {aka 'long int'} [-Wformat=]
48 | printf("%d", count(v.begin(), v.end(), v[n - 1]));
| ~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| int std::__iterator_traits<__gnu_cxx::__normal_iterator<int*, std::vector<int> >, void>::difference_type {aka long int}
| %ld
foo.cc: In instantiation of 'void Sort(T, T) [with T = int]':
foo.cc:47:11: required from here
foo.cc:34:16: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
34 | int mid = v[l + r >> 1], i = l - 1, j = r + 1;
| ~~^~~
foo.cc: In function 'void GetIn()':
foo.cc:25:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
25 | scanf("%d", &n);
| ~~~~~^~~~~~~~~~
foo.cc:27:15: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
27 | int x; scanf("%d", &x);
| ~~~~~^~~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务