Language: C++

#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;

typedef long long ll;
typedef long double ld;
template <typename T>
    using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

template <char cmp = '<'>
    bool icmp(ll a, ll b){ if(cmp=='>') return a > b; else return a < b;}
namespace enhanced_pair{
    typedef pair<ll,ll> pll;
    ostream& operator << (ostream& o, const pll a){
        o<<a.first<<" "<<a.second;
        return o;
    }
    istream& operator >> (istream& i, pll& p){
        i>>p.first>>p.second;
        return i;
    }
    template <char cmp1 = '<', char cmp2 = '<'>
        bool pcmp(pll a, pll b){ return icmp<cmp1> (a.first,b.first) || (a.first==b.first && icmp<cmp2> (a.second,b.second));}
    template <char cmp1 = '<', char cmp2 = '<'>
        struct pcmpobj{bool operator()(pll a, pll b){return pcmp<cmp1,cmp2>(a,b);}};
} using namespace enhanced_pair;
const ll BIG = 1e18;
const ll NMAX = 2e5+5;
const ll MOD = 1e9+7;
pll v[NMAX];
pll tofraction(string x){
    ll n=0,p2=0,p5=0,p10=0;
    bool point=0;
    for(ll i=0;i<x.size();i++)
        if(x[i]!='.')
            n=n*10+x[i]-'0';
    for(ll i=0;i<x.size();i++){
        if(point==1) p10++;
        if(x[i]=='.') point=1;
    }
    while(n && n%2==0){
        n/=2;
        p2++;
    }
    while(n && n%5==0){
        n/=5;
        p5++;
    }
    return {p2-p10,p5-p10};
}
map<pll,ll,pcmpobj<'<','<'>> cntatleast;
void tc(){
    ll n,ans=0;
    string x;
    cin>>n;
    for(ll i=0;i<n;i++){
        cin>>x;
        v[i]=tofraction(x);
        for(ll n1=-15;n1<=v[i].first;n1++)
            for(ll n2=-15;n2<=v[i].second;n2++)
                cntatleast[{n1,n2}]++;
    }
    for(ll i=0;i<n;i++){
        ans+=cntatleast[{-v[i].first,-v[i].second}]-(v[i].first>=0 && v[i].second>=0);
    }
    cout<<ans/2;
}
int main()
{
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    //ll q; cin>>q; while(q--)
        tc();

    return 0;
}


Compiler output:
In file included from /usr/include/c++/14/map:62,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_tree.h: In instantiation of 'static const _Key& std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_S_key(_Const_Link_type) [with _Key = std::pair<long long int, long long int>; _Val = std::pair<const std::pair<long long int, long long int>, long long int>; _KeyOfValue = std::_Select1st<std::pair<const std::pair<long long int, long long int>, long long int> >; _Compare = enhanced_pair::pcmpobj<'<', '<'>; _Alloc = std::allocator<std::pair<const std::pair<long long int, long long int>, long long int> >; _Const_Link_type = const std::_Rb_tree_node<std::pair<const std::pair<long long int, long long int>, long long int> >*]':
/usr/include/c++/14/bits/stl_tree.h:1648:17:   required from 'const _Key& std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Auto_node::_M_key() const [with _Key = std::pair<long long int, long long int>; _Val = std::pair<const std::pair<long long int, long long int>, long long int>; _KeyOfValue = std::_Select1st<std::pair<const std::pair<long long int, long long int>, long long int> >; _Compare = enhanced_pair::pcmpobj<'<', '<'>; _Alloc = std::allocator<std::pair<const std::pair<long long int, long long int>, long long int> >]'
 1648 |         { return _S_key(_M_node); }
      |                  ~~~~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_tree.h:2461:62:   required from 'std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_emplace_hint_unique(const_iterator, _Args&& ...) [with _Args = {const std::piecewise_construct_t&, std::tuple<std::pair<long long int, long long int>&&>, std::tuple<>}; _Key = std::pair<long long int, long long int>; _Val = std::pair<const std::pair<long long int, long long int>, long long int>; _KeyOfValue = std::_Select1st<std::pair<const std::pair<long long int, long long int>, long long int> >; _Compare = enhanced_pair::pcmpobj<'<', '<'>; _Alloc = std::allocator<std::pair<const std::pair<long long int, long long int>, long long int> >; iterator = std::_Rb_tree<std::pair<long long int, long long int>, std::pair<const std::pair<long long int, long long int>, long long int>, std::_Select1st<std::pair<const std::pair<long long int, long long int>, long long int> >, enhanced_pair::pcmpobj<'<', '<'>, std::allocator<std::pair<const std::pair<long long int, long long int>, long long int> > >::iterator; const_iterator = std::_Rb_tree<std::pair<long long int, long long int>, std::pair<const std::pair<long long int, long long int>, long long int>, std::_Select1st<std::pair<const std::pair<long long int, long long int>, long long int> >, enhanced_pair::pcmpobj<'<', '<'>, std::allocator<std::pair<const std::pair<long long int, long long int>, long long int> > >::const_iterator]'
 2461 |         auto __res = _M_get_insert_hint_unique_pos(__pos, __z._M_key());
      |                                                           ~~~~~~~~~~^~
/usr/include/c++/14/bits/stl_map.h:532:37:   required from 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = std::pair<long long int, long long int>; _Tp = long long int; _Compare = enhanced_pair::pcmpobj<'<', '<'>; _Alloc = std::allocator<std::pair<const std::pair<long long int, long long int>, long long int> >; mapped_type = long long int; key_type = std::pair<long long int, long long int>]'
  532 |           __i = _M_t._M_emplace_hint_unique(__i, std::piecewise_construct,
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  533 |                                         std::forward_as_tuple(std::move(__k)),
      |                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  534 |                                         std::tuple<>());
      |                                         ~~~~~~~~~~~~~~~
a.cc:63:35:   required from here
   63 |                 cntatleast[{n1,n2}]++;
      |                                   ^
/usr/include/c++/14/bits/stl_tree.h:768:15: error: static assertion failed: comparison object must be invocable as const
  768 |               is_invocable_v<const _Compare&, const _Key&, const _Key&>,
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_tree.h:768:15: note: 'std::is_invocable_v<const enhanced_pair::pcmpobj<'<', '<'>&, const std::pair<long long int, long long int>&, const std::pair<long long int, long long int>&>' evaluates to false