Language: C++

#pragma gcc optimize("Ofast,no-stack-protector,tune=native")
#pragma gcc optimize("sse,sse2,sse3,sse4,ssse3")
#pragma gcc optimize("O3")
#pragma gcc optimize("abm,mmx,avx,avx2,fast-math,section-anchors")
#pragma GCC optimize("Ofast,no-stack-protector,delete-null-pointer-check")
#pragma GCC target("tune=native")
#pragma GCC diagnostic error "-std=c++11"
#pragma GCC target("avx")
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline")
#pragma GCC optimize("-fgcse")
#pragma GCC optimize("-fgcse-lm")
#pragma GCC optimize("-fipa-sra")
#pragma GCC optimize("-ftree-pre")
#pragma GCC optimize("-ftree-vrp")
#pragma GCC optimize("-fpeephole2")
#pragma GCC optimize("-ffast-math")
#pragma GCC optimize("-fsched-spec")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("-falign-jumps")
#pragma GCC optimize("-falign-loops")
#pragma GCC optimize("-falign-labels")
#pragma GCC optimize("-fdevirtualize")
#pragma GCC optimize("-fcaller-saves")
#pragma GCC optimize("-fcrossjumping")
#pragma GCC optimize("-fthread-jumps")
#pragma GCC optimize("-funroll-loops")
#pragma GCC optimize("-fwhole-program")
#pragma GCC optimize("-freorder-blocks")
#pragma GCC optimize("-fschedule-insns")
#pragma GCC optimize("inline-functions")
#pragma GCC optimize("-ftree-tail-merge")
#pragma GCC optimize("-fschedule-insns2")
#pragma GCC optimize("-fstrict-aliasing")
#pragma GCC optimize("-fstrict-overflow")
#pragma GCC optimize("-falign-functions")
#pragma GCC optimize("-fcse-skip-blocks")
#pragma GCC optimize("-fcse-follow-jumps")
#pragma GCC optimize("-fsched-interblock")
#pragma GCC optimize("-fpartial-inlining")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("-freorder-functions")
#pragma GCC optimize("-findirect-inlining")
#pragma GCC optimize("-fhoist-adjacent-loads")
#pragma GCC optimize("-frerun-cse-after-loop")
#pragma GCC optimize("inline-small-functions")
#pragma GCC optimize("-finline-small-functions")
#pragma GCC optimize("-ftree-switch-conversion")
#pragma GCC optimize("-foptimize-sibling-calls")
#pragma GCC optimize("-fexpensive-optimizations")
#pragma GCC optimize("-funsafe-loop-optimizations")
#pragma GCC optimize("inline-functions-called-once")
#pragma GCC optimize("-fdelete-null-pointer-checks")
#pragma GCC optimize("avx2, O3")

#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <iomanip>
#include <deque>
#include <map>
#include <fstream>
#include <utility>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <numeric>
#include <random>
#include <math.h>
#include <cassert>
#include <bitset>
#include <chrono>
#include <sstream>
#include <array>

using namespace std;

#define DEBUG_VIVOD " SHTO-TO POSHLO NE TAK\n"
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define pb push_back
#define pf push_front
#define _USE_MATH_DEFINES
#define filin(x) freopen(x, "r", stdin)
#define filout(x) freopen(x, "w", stdout)
#define deq deque
#define vec vector
#define umap unordered_map
#define uset unordered_set
#define nan nullptr
#define rtn(x) {return x;}
#define putin cin
#define putout cout


//typedef long long ll;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef unsigned long long ui;

#define INF 1e9
mt19937 prof_rand(time(0));
#define rnd prof_rand()
#define MOD (1e9 + 7)



signed main() {
    ll n; putin >> n;
    map<pair<ll, ll>, ll> kk;
    while (n--) {
        ld mk; putin >> mk;
        ll tmp = llround(mk * 1e9);
        ll t = 0, f = 0;
        while (tmp % 2 == 0) {tmp /= 2; t++;}
        while (tmp % 5 == 0) {tmp /= 5; f++;}
        kk[make_pair(t, f)]++;
    }
    ll ans = 0;
    for (auto& it : kk) for (auto& jt : kk)
        if (it.first.first + jt.first.first >= 18 && it.first.second + jt.first.second >= 18) {
            if (it < jt) ans += it.second * jt.second;
            else if (it == jt) ans += it.second * (it.second - 1) / 2;
        }
    cout << ans;
    return 0;
}


Compiler output:
a.cc:5:74: warning: bad option '-fdelete-null-pointer-check' to pragma 'optimize' [-Wpragmas]
    5 | #pragma GCC optimize("Ofast,no-stack-protector,delete-null-pointer-check")
      |                                                                          ^
a.cc:7:30: warning: '-std=c++11' is not an option that controls warnings [-Wpragmas]
    7 | #pragma GCC diagnostic error "-std=c++11"
      |                              ^~~~~~~~~~~~
a.cc:29:39: warning: bad option '-fwhole-program' to pragma 'optimize' [-Wpragmas]
   29 | #pragma GCC optimize("-fwhole-program")
      |                                       ^
a.cc:36:41: warning: bad option '-fstrict-overflow' to pragma 'optimize' [-Wpragmas]
   36 | #pragma GCC optimize("-fstrict-overflow")
      |                                         ^
a.cc:38:41: warning: bad option '-fcse-skip-blocks' to pragma 'optimize' [-Wpragmas]
   38 | #pragma GCC optimize("-fcse-skip-blocks")
      |                                         ^
a.cc:52:51: warning: bad option '-funsafe-loop-optimizations' to pragma 'optimize' [-Wpragmas]
   52 | #pragma GCC optimize("-funsafe-loop-optimizations")
      |                                                   ^
a.cc:55:32: warning: bad option '-favx2' to pragma 'optimize' [-Wpragmas]
   55 | #pragma GCC optimize("avx2, O3")
      |                                ^
a.cc:55:32: warning: bad option '-f O3' to pragma 'optimize' [-Wpragmas]
a.cc:115:13: warning: bad option '-fdelete-null-pointer-check' to attribute 'optimize' [-Wattributes]
  115 | signed main() {
      |             ^
a.cc:115:13: warning: bad option '-fwhole-program' to attribute 'optimize' [-Wattributes]
a.cc:115:13: warning: bad option '-fstrict-overflow' to attribute 'optimize' [-Wattributes]
a.cc:115:13: warning: bad option '-fcse-skip-blocks' to attribute 'optimize' [-Wattributes]
a.cc:115:13: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
a.cc:115:13: warning: bad option '-favx2' to attribute 'optimize' [-Wattributes]
a.cc:115:13: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes]
In file included from /usr/include/c++/14/string:43,
                 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:57:
/usr/include/c++/14/bits/allocator.h: In destructor '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> >, std::less<std::pair<long long int, long long int> >, std::allocator<std::pair<const std::pair<long long int, long long int>, long long int> > >::_Rb_tree_impl<std::less<std::pair<long long int, long long int> >, true>::~_Rb_tree_impl()':
/usr/include/c++/14/bits/allocator.h:182:7: error: inlining failed in call to 'always_inline' 'std::allocator< <template-parameter-1-1> >::~allocator() noexcept [with _Tp = std::_Rb_tree_node<std::pair<const std::pair<long long int, long long int>, long long int> >]': target specific option mismatch
  182 |       ~allocator() _GLIBCXX_NOTHROW { }
      |       ^
In file included from /usr/include/c++/14/set:62,
                 from a.cc:63:
/usr/include/c++/14/bits/stl_tree.h:658:16: note: called from here
  658 |         struct _Rb_tree_impl
      |                ^~~~~~~~~~~~~