Language: C++

#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int,int> P;
int INF = 1e9+7;
int mod = 998244353;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int ans = 0;
map<int,int>Mp;
map<int,int>count;
void hantei(int now,vector<bool> &used) {
    ans += Mp[now];
    if(now*2 <= 10000 && used[now*2] == false) {
        used[now*2] = true;
        hantei(now*2,used);
    }
    if(now*5 <= 10000 && used[now*5] == false) {
        used[now*5] = true;
        hantei(now*5,used);
    }
    return;
}
signed main(){
    int N;
    cin >> N;
    vector<double>A(N);
    vector<double>sy;
    int sei = 0;
    for(int i = 0; i < N; i++) {
        cin >> A[i];
        int B = A[i];
        if(B == A[i]) {
            sei++;
            int cnt = 1;
            while(B%2 == 0) {
                cnt *= 2;
                B/=2;
            }
            while(B%5 == 0) {
                cnt *= 5;
                B/=5;
            }
            Mp[cnt]++;
        }
        else {
            double cnt = A[i];
            int res = 1;
            while((int)cnt != cnt) {
                cnt *= 10;
                res *= 10;
            }
            int sum = cnt;
            while(sum%2 == 0 && res%2 == 0) {
                res /= 2;
            }
            while(sum%5 == 0 && res%5 == 0) {
                res /= 5;
            }
            count[res]++;
            sy.push_back(res);
        }
    }
    int cnt2 = 0;
    for(int res:sy) {
        vector<bool>used(10005);
        hantei(res,used);
        int sum = 1;
        if(res%2 == 0) {
            while(res%2 == 0) {
                sum *= 5;
                res/=2;
            }
            while(sum <= 1000000000) {
                cnt2 += count[sum];
                sum *= 5;
            }
        }
        else {
            while(res%5 == 0) {
                sum *= 2;
                res/= 5;
            }
            while(sum <= 1000000000) {
                cnt2 += count[sum];
                sum *= 2;
            }
        }
    }
    cout << sei*(sei-1)/2+ans+cnt2/2 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:60:13: error: reference to 'count' is ambiguous
   60 |             count[res]++;
      |             ^~~~~
In file included from /usr/include/c++/14/algorithm:86,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
  101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
      | ^~~~~
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:4025:5: note:                 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)'
 4025 |     count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
      |     ^~~~~
a.cc:11:13: note:                 'std::map<long long int, long long int> count'
   11 | map<int,int>count;
      |             ^~~~~
a.cc:75:25: error: reference to 'count' is ambiguous
   75 |                 cnt2 += count[sum];
      |                         ^~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
  101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
      | ^~~~~
/usr/include/c++/14/bits/stl_algo.h:4025:5: note:                 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)'
 4025 |     count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
      |     ^~~~~
a.cc:11:13: note:                 'std::map<long long int, long long int> count'
   11 | map<int,int>count;
      |             ^~~~~
a.cc:85:25: error: reference to 'count' is ambiguous
   85 |                 cnt2 += count[sum];
      |                         ^~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
  101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
      | ^~~~~
/usr/include/c++/14/bits/stl_algo.h:4025:5: note:                 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)'
 4025 |     count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
      |     ^~~~~
a.cc:11:13: note:                 'std::map<long long int, long long int> count'
   11 | map<int,int>count;
      |             ^~~~~