Language: C++

/* src: (35 lines)

N = inputInt()
B[:N] = 0, 0
for i in range(N):
    a = int64(inputFloat() * 1e9+.5)
    #a, s = inputFraction64()
    #B[i] = -s, -s
    B[i] = -9, -9
    while a % 2 == 0:
        a /= 2
        ++B[i][0]
    while a % 5 == 0:
        a /= 5
        ++B[i][1]
M[:100] = vector!(int)(100)
++M[B[:N][0]+50][B[$1][1]+50]
sum = 0
sum += M[:100][:100]*M[100-$1:100][100-$2:100]
sum -= M[50:100][50:100]
print(sum/2)
'''
B.sort()
sum = 0
n = N - 1
bit = BIT!(int)(200)
for b2, b5 in B:
    assert -50<=b2<=50
    assert -50<=b5<=50
    while 0 <= n and 0 <= b2 + B[n][0]:
        ++bit[B[n][1] + 100]
        --n
    sum += bit.sum_back(100 - b5)
    sum -= 0 <= b2 and 0 <= b5
assert sum % 2 == 0
print(sum / 2)
'''

*/

//#define NDEBUG

#include <cassert>
#include <vector>
#include <deque>
#include <string>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <cstdlib>
#include <cstdio>
#include <cstring>

using namespace std;

const char*inputCLineOrWord(int mode){static char buf[2097152];static int bufLen=sizeof(buf);static int bufPos=sizeof(buf);static bool canReadFlag=true;static bool crFlag=false;static bool enterFlag=false;if(canReadFlag&&(enterFlag?bufLen<=bufPos:(int)sizeof(buf)<=bufPos+bufPos)){if(0<bufLen-bufPos){memmove(buf,buf+bufPos,bufLen-bufPos);bufLen-=bufPos;}else{bufLen=0;}char*result=fgets(buf+bufLen,sizeof(buf)-bufLen,stdin);canReadFlag=(result!=NULL);if(result!=NULL){int n=strlen(result);enterFlag=(n!=(int)sizeof(buf)-1-bufLen||(1<=bufLen+n&&buf[bufLen+n-1]=='\n'));bufLen+=n;}bufPos=0;}if(mode==0){int pos=bufPos;while(true){char c=buf[pos];if(c==32){buf[pos++]='\0';break;}else if(c==10){if(crFlag){crFlag=false;if(bufPos==pos){pos=++bufPos;continue;}}buf[pos++]='\0';break;}else if(c==13){crFlag=true;buf[pos++]='\0';break;}else if(c==0){break;}++pos;}const char*ret=buf+bufPos;bufPos=pos;while(true){char c=buf[bufPos];if(c==32||c==10||c==13){++bufPos;}else{break;}}return ret;}else if(mode==1){int pos=bufPos;while(true){char c=buf[pos];if(c==10){if(crFlag){crFlag=false;if(bufPos==pos){pos=++bufPos;continue;}}buf[pos++]='\0';break;}else if(c==13){crFlag=true;buf[pos++]='\0';break;}else if(c==0){break;}++pos;}const char*ret=buf+bufPos;bufPos=pos;if(crFlag){while(true){char c=buf[bufPos];if(c==13){++bufPos;crFlag=false;break;}else{break;}}}return ret;}else if(mode==2){return bufLen<=bufPos?NULL:buf+bufPos;}assert(false);return NULL;}const char*inputCWord(){return inputCLineOrWord(0);}int inputInt(){return atoi(inputCWord());}double inputFloat(){return atof(inputCWord());}void print_unit(bool val){printf("%s",val?"true":"false");}void print_unit(char val){printf("%c",val);}void print_unit(int val){printf("%d",val);}void print_unit(unsigned int val){printf("%u",val);}void print_unit(size_t val){printf("%zd",val);}void print_unit(const void*val){printf("%p",val);}void print_unit(long long val){printf("%lld",val);}void print_unit(__int128 val){char buf[128];int idx=128;buf[--idx]='\0';bool sign=false;if(val<0){sign=true;val=-val;}while(val){buf[--idx]='0'+(val % 10);val /=10;}if(sign){buf[--idx]='-';}printf("%s",buf+idx);}void print_unit(double val){printf("%g",val);}void print_unit(const char*val){printf("%s",val);}void print_unit(const std::string&val){printf("%s",val.c_str());}template<class T>void print_unit(const std::vector<T>&val){printf("vec(%d) {",(int)val.size());for(int i=0;i<(int)val.size();++i){fputc(' ',stdout);print_unit(val[i]);}printf(" }");}
#define _print0()
#define _print1(e)print_unit(e)
#define _print2(e1,e2)_print1(e1),fputc(' ',stdout),_print1(e2)
#define _print3(e1,e2,e3)_print2(e1,e2),fputc(' ',stdout),_print1(e3)
#define _print4(e1,e2,e3,e4)_print2(e1,e2),fputc(' ',stdout),_print2(e3,e4)
#define _print5(e1,e2,e3,e4,e5)_print3(e1,e2,e3),fputc(' ',stdout),_print2(e4,e5)
#define _print6(e1,e2,e3,e4,e5,e6)_print3(e1,e2,e3),fputc(' ',stdout),_print3(e4,e5,e6)
#define _print7(e1,e2,e3,e4,e5,e6,e7)_print4(e1,e2,e3,e4),fputc(' ',stdout),_print3(e5,e6,e7)
#define _print8(e1,e2,e3,e4,e5,e6,e7,e8)_print4(e1,e2,e3,e4),fputc(' ',stdout),_print4(e5,e6,e7,e8)
#define _print9(e1,e2,e3,e4,e5,e6,e7,e8,e9)_print5(e1,e2,e3,e4,e5),fputc(' ',stdout),_print4(e6,e7,e8,e9)
#define _print10(e1,e2,e3,e4,e5,e6,e7,e8,e9,e10)_print5(e1,e2,e3,e4,e5),fputc(' ',stdout),_print5(e6,e7,e8,e9,e10)
#define _GET_PRINT_MACRO_NAME(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,NAME,...)NAME
#define print(...)_GET_PRINT_MACRO_NAME(__VA_ARGS__,_print10,_print9,_print8,_print7,_print6,_print5,_print4,_print3,_print2,_print1,_print0)(__VA_ARGS__),fputc('\n',stdout)
#define print0(...)_GET_PRINT_MACRO_NAME(__VA_ARGS__,_print10,_print9,_print8,_print7,_print6,_print5,_print4,_print3,_print2,_print1,_print0)(__VA_ARGS__)

// generated code (by mmlang) :

int N;
vector<tuple<int, int> > B;
long long a;
vector<vector<long long> > M;
long long sum;

int main() {
    N = inputInt();
    B.resize(max((int)B.size(), (int)N)); for(int $1=0, $e=(0<=N ? N : (int)B.size()+N); $1<$e; ++$1) {
        const auto & $c1 = 0;
        const auto & $c2 = 0;
        B[$1] = tuple<int, int>($c1, $c2);
    }
    for(int i=0, $e=N; i<$e; ++i) {
        a = (long long)(inputFloat() * 1e9 + .5);
        {
            const auto & $c1 = -9;
            const auto & $c2 = -9;
            B[i] = tuple<int, int>($c1, $c2);
        }
        while(a % 2 == 0) {
            a /= 2;
            ++get<0>(B[i]);
        }
        while(a % 5 == 0) {
            a /= 5;
            ++get<1>(B[i]);
        }
    }
    M.resize(max((int)M.size(), (int)100)); for(int $1=0, $e=(0<=100 ? 100 : (int)M.size()+100); $1<$e; ++$1) M[$1] = vector<int>(100);
    for(int $1=0, $e=(0<=N ? N : (int)B.size()+N); $1<$e; ++$1) ++M[get<0>(B[$1]) + 50][get<1>(B[$1]) + 50];
    sum = 0;
    for(int $1=0, $e=(0<=100 ? 100 : (int)M.size()+100); $1<$e; ++$1) for(int $2=0, $e=(0<=100 ? 100 : (int)M[$1].size()+100); $2<$e; ++$2) for(int $b=100 - $1, $3=(0<=$b ? $b : (int)M.size()+$b), $e=(0<=100 ? 100 : (int)M.size()+100); $3<$e; ++$3) for(int $b=100 - $2, $4=(0<=$b ? $b : (int)M[$3].size()+$b), $e=(0<=100 ? 100 : (int)M[$3].size()+100); $4<$e; ++$4) sum += M[$1][$2] * M[$3][$4];
    for(int $1=(0<=50 ? 50 : (int)M.size()+50), $e=(0<=100 ? 100 : (int)M.size()+100); $1<$e; ++$1) for(int $2=(0<=50 ? 50 : (int)M[$1].size()+50), $e=(0<=100 ? 100 : (int)M[$1].size()+100); $2<$e; ++$2) sum -= M[$1][$2];
    print(sum / 2);
    "\nB.sort()\nsum = 0\nn = N - 1\nbit = BIT!(int)(200)\nfor b2, b5 in B:\n    assert -50<=b2<=50\n    assert -50<=b5<=50\n    while 0 <= n and 0 <= b2 + B[n][0]:\n        ++bit[B[n][1] + 100]\n        --n\n    sum += bit.sum_back(100 - b5)\n    sum -= 0 <= b2 and 0 <= b5\nassert sum % 2 == 0\nprint(sum / 2)\n";
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:104:134: error: no match for 'operator=' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::vector<long long int> >, std::vector<long long int> >::value_type' {aka 'std::vector<long long int>'} and 'std::vector<int>')
  104 |     M.resize(max((int)M.size(), (int)100)); for(int $1=0, $e=(0<=100 ? 100 : (int)M.size()+100); $1<$e; ++$1) M[$1] = vector<int>(100);
      |                                                                                                                                      ^
In file included from /usr/include/c++/14/vector:72,
                 from a.cc:44:
/usr/include/c++/14/bits/vector.tcc:210:5: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = long long int; _Alloc = std::allocator<long long int>]'
  210 |     vector<_Tp, _Alloc>::
      |     ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:211:42: note:   no known conversion for argument 1 from 'std::vector<int>' to 'const std::vector<long long int>&'
  211 |     operator=(const vector<_Tp, _Alloc>& __x)
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/14/vector:66:
/usr/include/c++/14/bits/stl_vector.h:766:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = long long int; _Alloc = std::allocator<long long int>]'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:766:26: note:   no known conversion for argument 1 from 'std::vector<int>' to 'std::vector<long long int>&&'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |                 ~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:788:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = long long int; _Alloc = std::allocator<long long int>]'
  788 |       operator=(initializer_list<value_type> __l)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:788:46: note:   no known conversion for argument 1 from 'std::vector<int>' to 'std::initializer_list<long long int>'
  788 |       operator=(initializer_list<value_type> __l)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~