結果

問題 No.1146 土偶Ⅰ
ユーザー shinba_777shinba_777
提出日時 2020-08-06 21:20:50
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 173 ms / 2,000 ms
コード長 283 bytes
コンパイル時間 110 ms
コンパイル使用メモリ 11,708 KB
実行使用メモリ 10,112 KB
最終ジャッジ日時 2023-10-21 20:08:02
合計ジャッジ時間 2,871 ms
ジャッジサーバーID
(参考情報)
judge15 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
10,112 KB
testcase_01 AC 28 ms
10,112 KB
testcase_02 AC 31 ms
10,112 KB
testcase_03 AC 49 ms
10,112 KB
testcase_04 AC 167 ms
10,112 KB
testcase_05 AC 50 ms
10,112 KB
testcase_06 AC 96 ms
10,112 KB
testcase_07 AC 150 ms
10,112 KB
testcase_08 AC 173 ms
10,112 KB
testcase_09 AC 70 ms
10,112 KB
testcase_10 AC 40 ms
10,112 KB
testcase_11 AC 90 ms
10,112 KB
testcase_12 AC 167 ms
10,112 KB
testcase_13 AC 27 ms
10,112 KB
testcase_14 AC 67 ms
10,112 KB
testcase_15 AC 144 ms
10,112 KB
testcase_16 AC 84 ms
10,112 KB
testcase_17 AC 28 ms
10,112 KB
testcase_18 AC 30 ms
10,112 KB
testcase_19 AC 72 ms
10,112 KB
testcase_20 AC 26 ms
10,112 KB
testcase_21 AC 39 ms
10,112 KB
testcase_22 AC 33 ms
10,112 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
from itertools import combinations
from functools import reduce

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

A = []
n = int(input())
ans = 0
for _ in range(n):
    A.append(int(input()))
for i,j,k in combinations(A,r=3):
    ans += (gcd(i,j,k)==1)
print(ans)
0