Problem:


Score : 300 points

Problem Statement

You are given N real values A_1, A_2, \ldots, A_N.
Compute the number of pairs of indices (i, j)
    such that i < j and the product A_i \cdot A_j is integer.

Constraints

2 \leq N \leq 200\,000

0 < A_i < 10^4

A_i is given with at most 9 digits after the decimal.

Input

Input is given from Standard Input in the following format.

N
A_1
A_2
\vdots
A_N

Output

Print the number of pairs with integer product A_i \cdot A_j (and i < j).

Sample Input 1

5
7.5
2.4
17.000000001
17
16.000000000

Sample Output 1

3

There are 3 pairs with integer product:

7.5 \cdot 2.4 = 18

7.5 \cdot 16 = 120

17 \cdot 16 = 272

Sample Input 2

11
0.9
1
1
1.25
2.30000
5
70
0.000000001
9999.999999999
0.999999999
1.000000001

Sample Output 2

8



Sample input:
5
7.5
2.4
17.000000001
17
16.000000000


Sample output:
3

Submission status: Wrong Answer

Solution code:
import bisect as bi
n=int(input())
l=[input() for i in range(n)]
sto=[]
numl=[[0 for j in range(19)] for i in range(19)]
intcnt=0
for i in range(n):
    s=l[i]
    pal=[0,0]
    if "." not in s:
        intcnt+=1
    else:
        cs=len(s)-s.index(".")-1
        pal=[-cs,-cs]
    N=int(s.replace(".",""))
    while N%5 == 0:
        N//=5
        pal[0]+=1
    while N%2 == 0:
        N//=2
        pal[1]+=1
    numl[min(18,pal[0]+9)][min(18,pal[1]+9)]+=1
    sto.append(pal)
ans=0
accnuml=[[0 for i in range(20)] for j in range(20)]
for i in range(1,20):
    for j in range(1,20):
        accnuml[i][j]=accnuml[i][j-1]+accnuml[i-1][j]-accnuml[i-1][j-1]+numl[i-1][j-1]
for i in range(n):
    x,y=sto[i][0],sto[i][1]
    ans+=n-(accnuml[min(-x+9,18)][-1]+accnuml[-1][min(-y+9,18)]-accnuml[min(18,-x+9)][min(18,-y+9)])
print((ans-intcnt)//2)

Submission status: Wrong Answer

Solution code:
a={}
c={}
ints=0
for i in range(int(input())):
  b=eval(input())
  if round(b,4)==b:
    if int(b)==b:
      if b not in c:
        c[b]=1
      else:c[b]+=1
      ints+=1
    else:
      te=eval(f'0.{str(b).split(".")[1]}')
      if te not in a:
        a[te]=1
      else:a[te]+=1
print(len([a[i]*a[j]for i in a for j in a if i*j==int(i*j)])+len([a[i]*c[j]for i in a for j in c if i*j==int(i*j)])+(ints*(ints-1)//2))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [0]*n
for i in range(n):
    a[i] = float(input())

ans = 0
for i in range(0, n-1):
    ss = [a[i]*s for s in a[i+1:] if a[i]*s == int(a[i]*s)]
    ans += len(ss)

print(ans)

Submission status: Wrong Answer

Solution code:
def cchange(c):
  if c == '0':
    return ''
  elif c [-1] == '0':
    c = c[:-1]
    c = cchange(c)
    return c
  else:
    return c

n = int(input())
l = [0]*n
for i in range(n):
  a = input()
  if not '.' in a:
    l[i] = [int(a) , -a.count('0')]
  else:
    b,c = a.split('.')
    c = cchange(c)
    if c == '':
      l[i] = [int(b) , -b.count('0')]
    else:
      l[i] = [int(b+c) , len(c)]

count = 0

for i in range(n):
  for j in range(i+1,n):
    if l[i][1] + l[j][1] <= 0:
      count += 1

print(count)

Submission status: Wrong Answer

Solution code:
import itertools
def count_intersect_result_integer(values):
  comb = list(itertools.combinations(values, 2))
  count = 0
  for value in comb:
    result = value[0] * value[1]
    if result.is_integer():
      count += 1
  return count
values = []
for i in range(int(input())):
  values.append(float(input()))

count = count_intersect_result_integer(values)
print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [input() for i in range(n)]
for i in range(n):
  if '.' in a[i]:
    a[i] = float(a[i])
  else:
    a[i] = int(a[i])
  
ans = 0
count = 0

print(a)
for i in range(n):
  for j in range(i + 1, n):
    ans = a[i]*a[j]
    if isinstance(ans, int):
      count += 1
    elif ans.is_integer():
      count += 1
print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
arr = []
cnt = 0

for i in range(n):
  f = float(input())
  _f = f*10000
  if _f.is_integer():
    arr += [f]

n = len(arr)

for i in range(n):
  for j in range(i+1, n):
    tmp = arr[i]*arr[j]
    if tmp.is_integer():
      cnt += 1
      
print(cnt)

Submission status: Wrong Answer

Solution code:
import numpy as np
n = int(input())
a = [input() for _ in range(n)]


ans = 0

for i in range(n-1):
    for j in range(i+1, n):
        ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
import sys
import math
from collections import defaultdict

sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7
input = lambda: sys.stdin.readline().strip()
NI = lambda: int(input())
NMI = lambda: map(int, input().split())
NLI = lambda: list(NMI())
SI = lambda: input()


def make_grid(h, w, num): return [[int(num)] * w for _ in range(h)]


def main():
    N = NI()
    A = [SI() for _ in range(N)]
    B = defaultdict(list)
    for a in A:
        if a.count(".") != 1:
            B[int(a)].append(1)
            continue
        ba, bb = a.split(".")
        ba = int(ba+bb)
        bb = 10**len(bb)
        g = math.gcd(ba, bb)
        ba //= g
        bb //= g
        B[ba].append(bb)

    facts = defaultdict(int)
    for ba, bbs in B.items():
        tmp = ba
        ba_fac_2 = 0
        while True:
            if tmp % 2: break
            ba_fac_2 += 1
            tmp //= 2
        tmp = ba
        ba_fac_5 = 0
        while True:
            if tmp % 5: break
            ba_fac_5 += 1
            tmp //= 5

        for bb in bbs:
            tmp = bb
            bb_fac_2 = 0
            while True:
                if tmp % 2: break
                bb_fac_2 += 1
                tmp //= 2
            tmp = bb
            bb_fac_5 = 0
            while True:
                if tmp % 5: break
                bb_fac_5 += 1
                tmp //= 5
            facts[(ba_fac_2 - bb_fac_2, ba_fac_5 - bb_fac_5)] += 1

    ans = 0
    for fact, k in list(facts.items()):

        fac2, fac5 = fact
        for i in range(-fac2, 14):
            for j in range(-fac5, 6):
                if fac2 == i and fac5 == j:
                    ans += k * (k-1)
                else:
                    ans += k * facts[(i, j)]


    print(ans//2)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(float(input()) for _ in range(n))

cnt = 0
for i in range(n):
    for j in range(n):
        if i < j:
            num = a[i] * a[j]
            if num.is_integer():
                cnt += 1
#                 print(a[i], "_", a[j],"=", num)
print(cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = [float(input()) for i in range(N)]
ans = 0
for i in range(N-1):
    for j in range(i+1, N):
        if a[i]*a[j].is_integer():
            ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = []
for j in range(n):
    a.append(float(input()))

ans = 0

import itertools
for i in itertools.combinations(a, 2):
    if i[0] * i[1] == int(i[0] * i[1]):
        ans += 1
    # print(ans, i[0], '*', i[1], i[0] * i[1], int(i[0] * i[1]))

print(ans)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline


def divide(n):
    c1, c2 = 0, 0
    while (n%2 == 0):
        c1 += 1
        n //= 2
    while (n%5 == 0):
        c2 += 1
        n //= 5
    return (c1, c2)
    

def main():
    n = int(input())
    a = [divide(int(float(input())*1e9)) for _ in range(n)]

    dp = [[0]*100 for _ in range(100)]
    for i in range(n):
        c1, c2 = a[i]
        dp[c1][c2] += 1
    
    for i in range(98, -1, -1):
        for j in range(98, -1, -1):
            dp[i][j] += dp[i+1][j]+dp[i][j+1]-dp[i+1][j+1]

    ans = 0
    for i in range(n):
        c1, c2 = a[i]
        if (c1 >= 9 and c2 >= 9):
            ans -= 1
        if c1 >= 18 and c2 >= 18:
            ans += dp[0][0]
            continue
        if c1 >= 18:
            ans += dp[0][18-c2]
            continue
        if c2 >= 18:
            ans += dp[18-c1][0]
            continue
        ans += dp[18-c1][18-c2]
        
    print(ans//2)
            
        
    
    
    
    
    
    
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())
l = [0]*N
count = 0
for i in range(N):
  l[i] = float(input())
for i in range(N-1):
  for j in range(i+1,N):
    if l[i]*l[j] - (l[i]*l[j])//1 == 0:
      count += 1
print(count)

Submission status: Wrong Answer

Solution code:
n = input()
n = int(n)
a = []
tp = 0
for i in range(n):
  tp = input()
  tp = float(tp)
  a.append(tp)
ans = 0
am = a.pop(0)
for num in range(len(a)):
  for idx in a:
    if (am*idx).is_integer() == True:
      ans+= 1
  a.append(am)
  am = a.pop(0)
print(int(ans/2))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [float(input()) for i in range(N)]
count = 0

for i in range(1,N):
    for j in range(i+1,N+1):
        if(A[i-1]*A[j-1] % 1 == 0):
            count += 1

print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
lst = []
new_lst = []
c = 0
for x in range(0, N):
    ele = float(input())
    lst.append(ele)
for i in lst:
    for j in lst:
        if i<j:
            a = i * j
            new_lst.append(a)
print(new_lst)
for b in new_lst:
    if b.is_integer():
        c += 1
    else:
        c += 0
print(c)

Submission status: Wrong Answer

Solution code:
from fractions import Fraction

n=int(input())

num=[]
twoP=[]
fiveP=[]
e=[]

for i in range(n):
    s=input()
    if "." in s: 
        b=len(s.split(".")[1])
    else:
        b=0
    s=int(s.replace(".",""))
    a=Fraction(s,10**b)

    if a.denominator==1:
        num.append(a)
    elif a.denominator%2==0 and a.denominator%5==0:
        e.append(a)
    elif a.denominator%5==0:
        fiveP.append(a)
    else:
        twoP.append(a)

ans= len(num)*(len(num)-1)//2

# for a in twoP:
#     for nu in num:
#         if nu.numerator%a.denominator==0:
#             ans+=1

# for a in fiveP:
#     for nu in num:
#         if nu.numerator%a.denominator==0:
#             ans+=1

# for a in e:
#     for nu in num:
#         if nu.numerator%a.denominator==0:
#             ans+=1


for a1 in twoP:
    for a2 in fiveP:
        if a1.numerator%a2.denominator==0 and a2.numerator%a1.denominator==0:
            ans+=1



print(ans)
# print(num)
# print(twoP)
# print(fiveP)
# print(e)

Submission status: Wrong Answer

Solution code:
import sys
import math
import copy
import heapq
from fractions import *
from decimal import *
from functools import cmp_to_key
from bisect import bisect_left, bisect_right
from collections import defaultdict, deque, Counter

sys.setrecursionlimit(1000000)

# input aliases
input = sys.stdin.readline
getS = lambda: input().strip()
getN = lambda: int(input())
getList = lambda: list(map(int, input().split()))
getZList = lambda: [int(x) - 1 for x in input().split()]

INF = float("inf")
MOD = 10 ** 9 + 7
divide = lambda x: pow(x, MOD - 2, MOD)


def nck(n, k, kaijyo):
    return (npk(n, k, kaijyo) * divide(kaijyo[k])) % MOD


def npk(n, k, kaijyo):
    if k == 0 or k == n:
        return n % MOD
    return (kaijyo[n] * divide(kaijyo[n - k])) % MOD


def fact_and_inv(SIZE):
    inv = [0] * SIZE  # inv[j] = j^{-1} mod MOD
    fac = [0] * SIZE  # fac[j] = j! mod MOD
    finv = [0] * SIZE  # finv[j] = (j!)^{-1} mod MOD
    inv[1] = 1
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    for i in range(2, SIZE):
        inv[i] = MOD - (MOD // i) * inv[MOD % i] % MOD
        fac[i] = fac[i - 1] * i % MOD
        finv[i] = finv[i - 1] * inv[i] % MOD

    return fac, finv


def renritsu(A, Y):
    # example 2x + y = 3, x + 3y = 4
    # A = [[2,1], [1,3]])
    # Y = [[3],[4]] または [3,4]
    A = np.matrix(A)
    Y = np.matrix(Y)
    Y = np.reshape(Y, (-1, 1))
    X = np.linalg.solve(A, Y)

    # [1.0, 1.0]
    return X.flatten().tolist()[0]


class TwoDimGrid:
    # 2次元座標 -> 1次元
    def __init__(self, h, w, wall="#"):
        self.h = h
        self.w = w
        self.size = (h + 2) * (w + 2)
        self.wall = wall
        self.get_grid()
        # self.init_cost()

    def get_grid(self):
        grid = [self.wall * (self.w + 2)]
        for i in range(self.h):
            grid.append(self.wall + getS() + self.wall)

        grid.append(self.wall * (self.w + 2))
        self.grid = grid

    def init_cost(self):
        self.cost = [INF] * self.size

    def pos(self, x, y):
        # 壁も含めて0-indexed 元々の座標だけ考えると1-indexed
        return y * (self.w + 2) + x

    def getgrid(self, x, y):
        return self.grid[y][x]

    def get(self, x, y):
        return self.cost[self.pos(x, y)]

    def set(self, x, y, v):
        self.cost[self.pos(x, y)] = v
        return

    def show(self):
        for i in range(self.h + 2):
            print(self.cost[(self.w + 2) * i:(self.w + 2) * (i + 1)])

    def showsome(self, tgt):
        for t in tgt:
            print(t)
        return

    def showsomejoin(self, tgt):
        for t in tgt:
            print("".join(t))
        return

    def search(self):
        grid = self.grid
        move = [(0, 1), (0, -1), (1, 0), (-1, 0)]
        move_eight = [(0, 1), (0, -1), (1, 0), (-1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)]
        # for i in range(1, self.h+1):
        #     for j in range(1, self.w+1):
        #         cx, cy = j, i
        #         for dx, dy in move_eight:
        #             nx, ny = dx + cx, dy + cy


def so(n):
    ret = []
    for i in range(2, int(math.sqrt(n) + 2)):
        if n % i == 0:
            ret.append(i)

    if ret == []:
        return [n]
    else:
        return ret


def getnig(n):
    ni, go = 0, 0
    while n % 2 == 0:
        ni += 1
        n //= 2
    while n % 5 == 0:
        go += 1
        n //= 5

    return min(18, ni), min(18, go)


def solve():
    # n = getN()
    # nums = []
    # bunsi = [0 for i in range(100)]
    # sei = 0
    # for i in range(n):
    #     S = getS()
    #     if "." not in S:
    #         sei += 1
    #         for sso in so(int(S)):
    #             bunsi[sso] += 1
    #
    #     else:
    #         nums.append(float(S))
    #
    # print(bunsi)
    # print(nums)
    # # for num in nums:
    # #     for s in so(num):
    # #         bunsi[s] += 1
    # # for
    n = getN()
    nums = []
    nigolis = [[0 for i in range(19)] for j in range(19)]
    for i in range(n):
        num = float(getS())
        if num == 0:
            nigolis[18][18] += 1
            nums.append((18,18))
            continue
        num *= 10 ** 9
        ni, go = getnig(num)
        nigolis[ni][go] += 1
        nums.append((ni, go))
    # print(nums)
    for i in range(18):
        for j in range(18):
            nigolis[i][j + 1] += nigolis[i][j]
    # for nigo in nigolis:
    #     print(nigo)
    ans = 0
    for tn, tg in nums:
        for i in range(18 - tn, 19):
            if tg == 18:
                ans += nigolis[i][-1]
            else:
                ans += nigolis[i][-1] - nigolis[i][18 - tg - 1]

        if tn >= 9 and tg >= 9:
            ans -= 1
        # print(ans)

    print(ans // 2)
    # print(Fraction(Decimal("0.3")).denominator)


def main():
    n = getN()
    for _ in range(n):
        solve()

    return


if __name__ == "__main__":
    # main()
    solve()

Submission status: Wrong Answer

Solution code:
data = []
N = int(input())
factor = 25600000
cnt = 0
for i in range(N):
    a = float(input())
    a_ = a * factor
    if int(a_) == a_:
        data.append(a)
N_ = len(data)
for i in range(N_-1):
    a = data[i]
    for j in range(i+1, N_):
        b = data[j]
        if a*b == int(a*b):
            cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
from math import *

cnt = [[0] * 60 for i in range(60)]

ans = 0
for _ in range(int(input())):
    t = float(input())
    b = int(t * 1000000000.0)
    x, y = 0, 0
    while b % 2 == 0:
        x += 1
        b //= 2
    while b % 5 == 0:
        y += 1
        b //= 5

    for i in range(60):
        for j in range(60):
            if i + x >= 18 and j + y >= 18:
                ans += cnt[i][j]
    cnt[x][y] += 1
print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np
n = int(input())
a = [float(input()) for _ in range(n)]
ans = 0

for i in range(n-1):
    for j in range(i+1, n):
        ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=[]
s=10**9
s2=s*s
for i in range(N):
  a=int(float(input())*s)
  if a%100000==0:
    A.append(a)
ans=0
l=len(A)
for i in range(l-1):
  for j in range(i+1,l):
    if A[i]*A[j]%(s2)==0:
      ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
newl = []
for i in range(n):
  a = float(input())
  newl.append(a)

cou = 0
for i in range(len(newl)):
    cur = newl[i]
    for j in newl[i+1:]:
        o = cur * j
        if o.is_integer() == True and cur < j:
            cou += 1

print(cou)

Submission status: Wrong Answer

Solution code:
import math
x = input()

A = []
for i in range(0, int(x)):
  val = input("")
  if val:
    A.append(val)


A.sort(reverse=True)

p = 0
for i in range(int(x)):
    for t in range(int(x)):
        if (i - t > 0) and float(A[i])*float(A[t]) == math.floor(float(A[i])*float(A[t])):
             p += 1
            
print(p)

Submission status: Wrong Answer

Solution code:
from fractions import Fraction

n=int(input())

num=[]
twoP=[]
fiveP=[]
e=[]

for i in range(n):
    s=input()
    if "." in s: 
        b=len(s.split(".")[1])
    else:
        b=0
    s=int(s.replace(".",""))
    a=Fraction(s,10**b)

    if a.denominator==1:
        num.append(a)
    elif a.denominator%2==0 and a.denominator%5==0:
        e.append(a)
    elif a.denominator%5==0:
        fiveP.append(a)
    else:
        twoP.append(a)

ans= len(num)*(len(num)-1)//2

for a in twoP:
    for nu in num:
        if nu.numerator%a.denominator==0:
            ans+=1

for a in fiveP:
    for nu in num:
        if nu.numerator%a.denominator==0:
            ans+=1

for a in e:
    for nu in num:
        if nu.numerator%a.denominator==0:
            ans+=1


# for a1 in twoP:
#     for a2 in fiveP:
#         if a1.numerator%a2.denominator==0 and a2.numerator%a1.denominator==0:
#             ans+=1



print(ans)
# print(num)
# print(twoP)
# print(fiveP)
# print(e)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
#N = 1

A = [math.modf(float(input())*10000) for _ in range(N)]


counter = 0
for i in range(N-1):
	for j in range(i+1, N):
		num = (A[i][0]*A[j][0] + A[i][0]*A[j][1] + A[i][1]*A[j][0] + A[i][1]*A[j][1])/100000000
		#print(num)
		if int(num)==num:
			counter += 1
print(counter)

Submission status: Wrong Answer

Solution code:
n = int(input())
a_lst = []
for i in range(n):
    x = float(input())
    # x *= 10 ** 9
    a_lst.append(x)
startnum = 1
ans = 0
for i in a_lst:
    for j in range(startnum, n):
        # print(i, j)
        if ((i * 10 ** 9 * a_lst[j] * 10 ** 9) / (10 ** 18)) % 1 == 0:
        # if (i * a_lst[i] / 10 ** 18 % 1 == 0):
            # print(i, a_lst[j], j)

            ans += 1
    startnum += 1
print(ans)

# 2 * 3 = 6
# 2 *100 * 3 * 100 = 60000
# 2 * 100 * 3 * 100 / 100 = 600
# 2 * 100 * 3 * 100 / 100**2 = 6

Submission status: Wrong Answer

Solution code:
from decimal import Decimal
N = int(input())

A = [input() for i in range(N)]
A2 = list(map(Decimal, A))


flg_lst = [0]*N
for i in range(N):
    A_dec = A[i][len(str(int(float(A[i]))))+1:]
    if (len(A_dec) >= 5) and (A_dec[5:]!='0'*len(A_dec[5:])):
        flg_lst[i] = 1

cnt = 0
for i in range(N):
    if flg_lst[i] ==1:
        continue
    for j in range(i+1,N):
        if flg_lst[j] ==1:
            continue
        prod = A2[i]*A2[j]
        if prod == int(prod):
            cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
from decimal import *
n = int(input())
a = []
for _ in range(n):
    a.append(Decimal(input()))

ans = 0
for i in range(n):
    for j in range(n):
        if i < j:
            d = a[i]*a[j]
            f = float(d)
            if f.is_integer():
                ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
import itertools

N = int(input())
num_list = [float(input()) for _ in range(N)]

cnt = 0
num_comb_list = list(itertools.combinations(num_list, 2))
num_comb_list_len = len(list(itertools.combinations(num_list, 2)))
for num_comb in num_comb_list:
  if (num_comb[0] * num_comb[1]).is_integer():
    cnt += 1
    
print(cnt)

Submission status: Wrong Answer

Solution code:
from decimal import Decimal
n = int(input())

a = []
for i in range(n):
    t = Decimal(input())
    if (t < 1):
        t += 1
    a.append(t)

a.sort()
ans = 0
for i in range(n):
    for j in range(i+1, n):
        t = a[i] * a[j]
        if (float(t).is_integer()):
            ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a_lst = []
for i in range(n):
    x = float(input())
    # x *= 10 ** 9
    a_lst.append(x)
startnum = 1
ans = 0
for i in a_lst:
    for j in range(startnum, n):
        # print(i, j)
        if ((i * 10 ** 9 * a_lst[j] * 10 ** 9) / (10 ** 18)) % 1 == 0:
        # if (i * a_lst[i] / 10 ** 18 % 1 == 0):
            print(i, a_lst[j], j)

            ans += 1
    startnum += 1
print(ans)

# 2 * 3 = 6
# 2 *100 * 3 * 100 = 60000
# 2 * 100 * 3 * 100 / 100 = 600
# 2 * 100 * 3 * 100 / 100**2 = 6

Submission status: Wrong Answer

Solution code:
n = int(input()) 
lst=[] 
# iterating till the range 
for i in range(0, n): 
    ele = float(input()) 
  
    lst.append(ele)


count=0
for i in range(0,len(lst)-1):
    for j in range(i+1,len(lst)):
        
        if (lst[i]*lst[j]).is_integer()==True:

            count+=1

print(count)

Submission status: Wrong Answer

Solution code:
n=int(input())
A=[]
for i in range(n):
    a=float(input())
    A.append(a)
x=0
for i in range(n-1):
    for j in range(n-i-1):
        b=10**9*A[i]
        c=10**9*A[i+1+j]
        d=b*c
        if d%(10**18)==0:
            x+=1
print(x)

Submission status: Wrong Answer

Solution code:
n = int(input()) 
lst=[] 
# iterating till the range 
for i in range(0, n): 
    ele = float(input()) 
  
    lst.append(ele)


count=0
for i in range(0,len(lst)-1):
    for j in range(i+1,len(lst)):
        
        if (lst[i]*lst[j]).is_integer()==True:
            print( lst[i]*lst[j],lst[i],lst[j])
            count+=1
            print('count',count)
print(count)

Submission status: Wrong Answer

Solution code:
from decimal import Decimal
n = int(input())
a = [Decimal(input()) for _ in range(n)]

s = 0
for j in range(n):
    for i in range(j):
        if a[i]%1 and a[j]%1:
            continue
        if not a[i]*a[j]%1: s += 1

print(s)

Submission status: Wrong Answer

Solution code:
def count_intersect_result_integer(values, index):
  count = 0
  for i in range(index + 1,len(values)):
    result = values[i] * values[index]
    if result.is_integer():
      count += 1
  
  return count

values = []
for i in range(int(input())):
  values.append(float(input()))

count = 0
for i in range(len(values)):
  count += count_intersect_result_integer(values, i)

print(count)

Submission status: Wrong Answer

Solution code:
t=int(input())
l=[]
c=0
for i in range(t):
  l.append(float(t))
for i in range(len(l)):
  for j in range(1,len(l)):
    a=str(l[i]*l[j])
    for p in range(1,len(a)+1):
      if p=='.':
        if a[p+1:]=='0'*(len(a)-p):
          c+=1
print(c)

Submission status: Wrong Answer

Solution code:
import itertools
n = int(input())
A = [float(input()) for _ in range(n)]

cnt = 0
for pair in itertools.combinations(A, 2):
    if (pair[0] * pair[1]).is_integer():
        cnt += 1
        
print(cnt)

Submission status: Wrong Answer

Solution code:
import math

# 入力
n = int(input())
a_list = []
for e in range(n):
    # a_list.append(list(map(float,input().split())))
    a_list.append(float(input()) * 1000000000)

count = 0

print("a_list : {0}".format(a_list))

# iは0からスタート
for i in range(n):

    # jはiより1大きい
    for j in range(i + 1, n):

        # print("i : {0}".format(i))
        # print("j : {0}".format(j))

        # a = float(a_list[i])
        # b = float(a_list[j])

        # print("a : {0}".format(a))
        # print("b : {0}".format(b))

        # print("a_list[i] : {0}".format(a_list[i]))
        # print("a_list[j] : {0}".format(a_list[j]))

        if ((a_list[i] / 1000000000) * (a_list[j] / 1000000000)) % 1 == 0 :
            count += 1

        # if math.modf(a_list[i] * a_list[j]) == 0 :
        #     count += 1

print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [0]*n
for i in range(n):
    a[i] = float(input())

ans = 0
for i in range(0, n-1):
    for j in range(i+1, n):
        s = a[i]*a[j]
        t = int(a[i]*a[j])
        if s == t:
            ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
from fractions import Fraction

n=int(input())

num=[]
twoP=[]
fiveP=[]
e=[]

for i in range(n):
    s=input()
    if "." in s: 
        b=len(s.split(".")[1])
    else:
        b=0
    s=int(s.replace(".",""))
    a=Fraction(s,10**b)

    if a.denominator==1:
        num.append(a)
    elif a.denominator%2==0 and a.denominator%5==0:
        e.append(a)
    elif a.denominator%5==0:
        fiveP.append(a)
    else:
        twoP.append(a)

ans= len(num)*(len(num)-1)//2

# for a in twoP:
#     for nu in num:
#         if nu.numerator%a.denominator==0:
#             ans+=1

# for a in fiveP:
#     for nu in num:
#         if nu.numerator%a.denominator==0:
#             ans+=1

# for a in e:
#     for nu in num:
#         if nu.numerator%a.denominator==0:
#             ans+=1


# for a1 in twoP:
#     for a2 in fiveP:
#         if a1.numerator%a2.denominator==0 and a2.numerator%a1.denominator==0:
#             ans+=1



print(ans)
# print(num)
# print(twoP)
# print(fiveP)
# print(e)

Submission status: Wrong Answer

Solution code:
n=int(input())
a,ans=[],[]
for _ in range(n):
  i = float(input())
  a.append(i)
for i in range(n-1):
  for j in range(1,n-i):
    time = a[i] * a[i+j]
    #print(time)
    if time.is_integer():
      ans.append(int(time))
print(len(ans))

Submission status: Wrong Answer

Solution code:
n = int(input())

a = [float(input()) for _ in range(n)]

cnt = 0
for i in a:
    for j in a:
        if i < j:
            mul = i * j
            is_int = mul.is_integer()
            if is_int:
                cnt += 1

print(cnt)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
numList = []

user = int(input())
inputCount = user
count = 0

for i in range(inputCount):
    user = float(input())
    numList.append(user)

for i in range( len(numList) ):
    for j in range(len(numList)  - i - 1):
        j_n = i + j + 1

        #print(i, j_n, float.is_integer( numList[i] * numList[j_n]), numList[i], numList[j_n], numList[i] * numList[j_n])
        if float.is_integer( numList[i] * numList[j_n]):
            count += 1

print(count,end="")

Submission status: Wrong Answer

Solution code:
N = int(input())
A = []
for i in range(N):
    A.append(float(input()) * 10**5)

ans = [[0] * N for n in range(N)]

for i in range(N):
    for j in range(i+1, N):
        if ans[i][j] == 0:
            ans[i][j] = (A[i] * A[j])

count = 0
for i in range(N):
    for j in range(i + 1, N):
        if ((ans[i][j] / 10**5).is_integer() and (ans[i][j] / 10**10).is_integer()) and ans[i][j] != 0:
            count += 1
print(ans)
print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
arr = []
cnt = 0

for i in range(n):
  s = input()
  f = float(s)
  spl = s.split('.')
  if len(spl) == 2 and len(spl[1]) > 4 and int(spl[1][4:]) != 0:
    pass
  else:
  	arr += [f]

n = len(arr)

for i in range(n):
  for j in range(i+1, n):
    tmp = arr[i]*arr[j]
    if tmp.is_integer():
      cnt += 1
      
print(cnt)

Submission status: Wrong Answer

Solution code:
n = input()
n = int(n)
a = []
tp = 0
for i in range(n):
  tp = input()
  tp = float(tp)
  a.append(tp)
ans = 0
am = a.pop(0)
sa = am
for num in range(len(a)):
  for idx in a:
    if (am*idx).is_integer() == True:
      ans+= 1
  a.append(sa)
  am = a.pop(0)
  if am == sa:
    break
print(int(ans/2))

Submission status: Wrong Answer

Solution code:
N=int(input())
a=[float(input()) for n in range(N)]
b=0
c=0
if float.is_integer(a[N-1]) is True:
    c+=1
for v in range(N-1):
  for i in range(N-2):
        if float.is_integer(a[v]*a[i+1]) is True:
          b+=1
print(b-c)

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
a = [float(input()) for _ in range(n)]

count = 0

for i in range(n):
    x, y = math.modf(a[i])
    for j in range(i+1,n):
        x, y = math.modf(a[i]*a[j])
        if x == 0:
            count += 1
            #print('{0}, {1}'.format(i+1,j+1))



print(count)

Submission status: Wrong Answer

Solution code:
import sys
import copy
import math

count = int(sys.stdin.readline())
values = []
for i in range(count):
    values.append(float(sys.stdin.readline()))
values2 = copy.copy(values)
for i in range(count):
    v, _ = math.modf(values[i])
    if str(v)[-1] in ('0', '2', '5', '4', '6', '8'):
        values2[i] = None
result = 0
for i in range(count):
    if values2[i] is not None:
        for j in range(i+1, count):
            if values2[j] is not None:
                v, _ = math.modf(values[i] * values[j])
                if v == 0:
                    result += 1
print(result)

Submission status: Wrong Answer

Solution code:
n = int(input())
arr = []
cnt = 0

for i in range(n):
  s = input()
  f = float(s)
  spl = s.split('.')
  if len(spl) == 2 and len(spl[1]) > 4 and int(spl[1][4:]) != 0:
    pass
  else:
  	arr += [f]
print(arr)
n = len(arr)

for i in range(n):
  for j in range(i+1, n):
    tmp = arr[i]*arr[j]
    if tmp.is_integer():
      cnt += 1
      
print(cnt)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N=I()
    from collections import defaultdict
    dd = defaultdict(int)
    dd2 = defaultdict(int)
    S=0

    
    for _ in range(N):
        c=input()
        if "." in c:
            c2=float(c)
            c=int(c2*(10**10))
            i=0
            j=0
            while c%2==0:
                c=c//2
                i+=1
            while c%5==0:
                c=c//5
                j+=1
            i-=10
            j-=10
            i=min(i,10)
            j=min(j,10)
            if min(i,j)>=0:
                dd2[(i,j)]+=1
                S+=1
            else:
                dd[(i,j)]+=1

        else:
            c=int(c)
            i=0
            j=0
            while c%2==0:
                c=c//2
                i+=1
            while c%5==0:
                c=c//5
                j+=1
            i=min(i,10)
            j=min(j,10)
            dd2[(i,j)]+=1
            S+=1
            
    ans=(S*(S-1))
    
    K=[]
    V=[]
    for k,v in dd.items():
        K.append(k)
        V.append(v)
        
    
    for iiii in range(len(K)):
        k=K[iiii]
        v=V[iiii]
    
        ii,jj=k
        for i in range(-10,11):
            for j in range(-10,11):
                if ii+i>=0 and jj+j>=0:
                    ans+=dd2[(i,j)]*v*2
                    ans+=dd[(i,j)]*v
                    
                    
                    
    print(ans//2)
            
    

            
                    
                       

 
               

main()