foo.cc: In function 'int main()':
foo.cc:25:31: error: reference to 'count' is ambiguous
25 | for(int i=1;i<=n;i++) count+=cnt[i];
| ^~~~~
In file included from /nix/store/dm8k43g793kzl9rc4s12hh2fdwxwsb67-gcc/include/c++/12.3.0/algorithm:61,
from foo.cc:2:
/nix/store/dm8k43g793kzl9rc4s12hh2fdwxwsb67-gcc/include/c++/12.3.0/bits/stl_algo.h:4026:5: note: candidates are: 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)'
4026 | count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
| ^~~~~
foo.cc:9:5: note: 'int count'
9 | int count=0;
| ^~~~~
[Hydro](https://hydro.ac)提供评测服务