結果

問題 No.1146 土偶Ⅰ
ユーザー Soratop
提出日時 2020-12-06 16:51:32
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 199 ms / 2,000 ms
コード長 301 bytes
コンパイル時間 180 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-09-17 13:08:01
合計ジャッジ時間 2,682 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

n=int(input())
a=[int(input()) for i in range(n)]
c=0
for i in range(n):
    for j in range(i+1,n):
        for k in range(j+1,n):
            if gcd(*[a[i],a[j],a[k]])==1:
                c+=1
print(c)
0