Language: C++

#include <bits/stdc++.h>

int main() {
  int n; std::cin >> n;
  std::vector<double> a(n);
  for (int i = 0; i < n; ++i) std::cin >> a[i];
  
  /* ピリオドをすべての文字列に加える */
  for (int i = 0; i < n; i++)
    if (a[i].find('.') == std::string::npos) // ピリオドの有無
      a[i].push_back('.');                   // ピリオドを末尾に加える
  
  /* key:val = (c2, c5):cnt */
  std::map<std::pair<int, int>, int> p;

  /* aの素因数2と5の数を数える */
  for (int i = 0; i < n; i++) {
    // a[i].length() => 文字列の長さ
    // a[i].find('.') => .(ピリオド)が存在すればその位置, なければstd::string::npos

    // std::cout << a[i] << " " <<  a[i].length() - a[i].find('.') - 1 << std::endl;
    /* 小数点以下の数 */
    int d_cnt = a[i].length() - a[i].find('.') - 1;
    int c2 = -d_cnt; // 2の数を-d_cntで初期化
    int c5 = -d_cnt; // 5の数を-d_cntで初期化
    
    /* 文字を数字に変換 */
    a[i].replace(a[i].find('.'), 1, ""); // .(ピリオド)を削除 str.replace(開始位置, 長さ, 置き換え後の新たな文字列)
    long long a_ll = std::stoll(a[i].c_str()); // long longに変換
    
    /* 2の数を取得 */
    while (a_ll%2 == 0) {
      ++c2;
      a_ll /= 2;
    }
    /* 5の数を取得 */
    while (a_ll%5 == 0) {
      ++c5;
      a_ll /= 5;
    }

    /* mapに key:val = (c2, c5):数 保持 */
    p[std::pair<int, int>(c2, c5)]++; // keyが存在しない場合は0が追加される
  }

  long long cnt = 0;
  for (auto itr = p.begin(); itr != p.end(); ++itr) {
    if (itr->first.first >= 0 && itr->first.second >= 0)
      cnt += itr->second*(itr->second-1)/2;

    for (auto itr_2 = std::next(itr, 1); itr_2 != p.end(); ++itr_2) {
      if (itr->first.first + itr_2->first.first >= 0 && itr->first.second + itr_2->first.second >= 0)
        cnt += itr->second * itr_2->second;
    }

  }
  std::cout << cnt << std::endl;


  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: request for member 'find' in 'a.std::vector<double>::operator[](((std::vector<double>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type' {aka 'double'}
   10 |     if (a[i].find('.') == std::string::npos) // ピリオドの有無
      |              ^~~~
a.cc:11:12: error: request for member 'push_back' in 'a.std::vector<double>::operator[](((std::vector<double>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type' {aka 'double'}
   11 |       a[i].push_back('.');                   // ピリオドを末尾に加える
      |            ^~~~~~~~~
a.cc:23:22: error: request for member 'length' in 'a.std::vector<double>::operator[](((std::vector<double>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type' {aka 'double'}
   23 |     int d_cnt = a[i].length() - a[i].find('.') - 1;
      |                      ^~~~~~
a.cc:23:38: error: request for member 'find' in 'a.std::vector<double>::operator[](((std::vector<double>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type' {aka 'double'}
   23 |     int d_cnt = a[i].length() - a[i].find('.') - 1;
      |                                      ^~~~
a.cc:28:10: error: request for member 'replace' in 'a.std::vector<double>::operator[](((std::vector<double>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type' {aka 'double'}
   28 |     a[i].replace(a[i].find('.'), 1, ""); // .(ピリオド)を削除 str.replace(開始位置, 長さ, 置き換え後の新たな文字列)
      |          ^~~~~~~
a.cc:28:23: error: request for member 'find' in 'a.std::vector<double>::operator[](((std::vector<double>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type' {aka 'double'}
   28 |     a[i].replace(a[i].find('.'), 1, ""); // .(ピリオド)を削除 str.replace(開始位置, 長さ, 置き換え後の新たな文字列)
      |                       ^~~~
a.cc:29:38: error: request for member 'c_str' in 'a.std::vector<double>::operator[](((std::vector<double>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type' {aka 'double'}
   29 |     long long a_ll = std::stoll(a[i].c_str()); // long longに変換
      |                                      ^~~~~