結果

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

ソースコード

diff #

import math
from functools import reduce
from itertools import combinations

def gcd_list(numbers):
    return reduce(math.gcd, numbers)
n = int(input())
a = [int(input())for i in range(n)]
count = 0
a_list =list(combinations(a,3))
for i in a_list:
    if gcd_list(i) ==1:
        count +=1

print(count)
0