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;
ll lastbit(ll num){
    return num & -num;
}
ll binPow(ll num, ll p, ll mod){
    if(!p) return 1;
    ll aux = binPow(num,p/2,mod);
    return aux*aux%mod*(p%2?num:1)%mod;
}
inline ll modInv(ll num, ll mod){
    return binPow(num,mod-2,mod);
}
template<typename T,size_t maxSize,typename __merge_function, T& defaultValue>
class segmentTree{
    public : struct STnode{size_t l,r; T val=defaultValue;} data[maxSize*4];
    size_t leaves[maxSize];
    private : __merge_function merge_function;
    #define __curr_node data[nodeID]
    #define __prev_node data[(nodeID-1)/2]
    public : void init(size_t nodeID = 0){ /// initializing function
        if(nodeID == 0) __curr_node.l = 0, __curr_node.r = maxSize-1;
        else{
            if(nodeID & 1) {__curr_node.l=__prev_node.l; __curr_node.r=(__prev_node.l+__prev_node.r)/2;}
            else {__curr_node.r=__prev_node.r; __curr_node.l=(__prev_node.l+__prev_node.r)/2+1;}
        }
        if(__curr_node.l==__curr_node.r) leaves[__curr_node.l]=nodeID;
        else {init(nodeID*2+1); init(nodeID*2+2);}
    }
    public : void reset(){
        for(ll i=0;i<maxSize*4;i++) data[i].val=defaultValue;
    }
    private : inline size_t parent(size_t nodeID){ /// parent of nodeID
        if(nodeID) return (nodeID-1)/2;
        else return -1;
    }
    public : void set(size_t nodeID, T value){ /// replaces the element at position *nodeID* with *value*
        nodeID = leaves[nodeID];
        __curr_node.val = value; nodeID = parent(nodeID);
        while(nodeID > 0){
            __curr_node.val = merge_function(data[nodeID*2+1].val,data[nodeID*2+2].val);
            nodeID = parent(nodeID);
        }
        __curr_node.val = merge_function(data[nodeID*2+1].val,data[nodeID*2+2].val);
    }
    public : T operator [] (size_t nodeID){
        return data[leaves[nodeID]].val;
    }
    public : T query(size_t L, size_t R){ /// computes the merge function across all elements in the interval [L,R]
        if(L > R) return defaultValue;
        size_t nodeID = leaves[L];
        while(nodeID > 0 && __prev_node.l>=L && __prev_node.r<=R)
            nodeID = parent(nodeID);
        return merge_function(__curr_node.val,query(__curr_node.r+1,R));
    }
    #undef __curr_node
    #undef __prev_node
};

class Fenwick{
    private : vector<ll> data;
    public : void resize(size_t newSize){data.resize(newSize+1);};
    public : void clear(){fill(data.begin(),data.end(),0);};
    public : void add(ll pos,ll val){
        if(pos<data.size()){
            data[pos]+=val;
            add(pos+lastbit(pos),val);
        }
    }
    private : ll pref_query(ll pos){
        if(pos==0) return 0;
        return data[pos]+pref_query(pos-lastbit(pos));
    }
    public : ll query(ll pos1, ll pos2){
        return pref_query(pos2)-pref_query(pos1-1);
    }
};
const ll BIG = 1e18;
const ll NMAX = 2e2+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=-10;n1<=v[i].first;n1++)
            for(ll n2=-10;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:138:35:   required from here
  138 |                 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