Language: C++

#include<iostream>
#include<algorithm>
#include<cstdio>
#define N 200020
#define int long long
#define inf 1e9
using namespace std;

int n,cnt,ans;
int root[N];

double data[N];

struct node{
	int p2,p5;
}num[N];

int calc(int x,int y,int s=0){
	while(x%y==0)s++,x/=y;
	return s;
}

bool operator<(node x,node y){
	if(x.p2!=y.p2)return x.p2>y.p2;
	else return x.p5>y.p5;
}

int getrk(int x){
	int l=0,r=n+1;
	while(r-l>1){
		int mid=(l+r)>>1;
		if(num[mid].p2>=x)l=mid;
		else r=mid;
//		printf("get %lld %lld %lld %lld\n",l,r,mid,x);
	}
	return l;
}

struct TREE{
	int val,ls,rs;
}tree[N];

#define L(x) tree[x].ls
#define R(x) tree[x].rs
#define mid ((l+r)>>1)
#define lson L(x),l,mid
#define rson R(x),mid+1,r

void update(int x){
	tree[x].val=tree[L(x)].val+tree[R(x)].val;
}

void build(int &x,int l,int r,int s){
	if(s<l||s>r)return;
	tree[++cnt]=tree[x],x=cnt;
//	printf("run: %lld %lld %lld %lld\n",x,l,r,s);
	if(!(l^r)){tree[x].val++;return;}
	build(lson,s),build(rson,s);
	update(x);
}

int query(int x,int l,int r,int s){
//	printf("%lld %lld %lld %lld\n",x,l,r,s);
//	system("pause");
	if(!(l^r))return tree[x].val;
	if(s>mid)return query(rson,s);
	else return tree[R(x)].val+query(lson,s);
}

void init(){
	scanf("%lld",&n);
	for(int i=1;i<=n;i++){
		scanf("%lf",&data[i]);
		data[i]*=inf;
//		printf("%lf\n",data[i]);
	}
	for(int i=1;i<=n;i++){
		num[i].p2=calc(data[i],2),num[i].p5=calc(data[i],5);
	}
	sort(num+1,num+1+n);
	for(int i=1;i<=n;i++){
		root[i]=root[i-1];
		build(root[i],1,30,num[i].p5+1);
//		printf("root: %lld %lld %lld %lld\n",i,root[i],num[i].p2,num[i].p5);
	}
//	printf("xxx\n");
	for(int i=1;i<=n;i++){
		int pos=getrk(18-num[i].p2);
//		printf("fuckljx %lld\n",pos);
		int now=query(root[pos],1,30,19-num[i].p5);
		if((num[i].p2<<1)>=18&&(num[i].p5<<1)>=18)now--;
		ans+=now;
	}
	printf("%lld\n",ans>>1);
}

#undef int

int main(){
	init();
}

Compiler output:
a.cc: In function 'void init()':
a.cc:73:30: error: reference to 'data' is ambiguous
   73 |                 scanf("%lf",&data[i]);
      |                              ^~~~
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:12:8: note:                 'double data [200020]'
   12 | double data[N];
      |        ^~~~
a.cc:74:17: error: reference to 'data' is ambiguous
   74 |                 data[i]*=inf;
      |                 ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:12:8: note:                 'double data [200020]'
   12 | double data[N];
      |        ^~~~
a.cc:78:32: error: reference to 'data' is ambiguous
   78 |                 num[i].p2=calc(data[i],2),num[i].p5=calc(data[i],5);
      |                                ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:12:8: note:                 'double data [200020]'
   12 | double data[N];
      |        ^~~~
a.cc:78:58: error: reference to 'data' is ambiguous
   78 |                 num[i].p2=calc(data[i],2),num[i].p5=calc(data[i],5);
      |                                                          ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:12:8: note:                 'double data [200020]'
   12 | double data[N];
      |        ^~~~