結果

問題 No.1146 土偶Ⅰ
ユーザー jt_aistjt_aist
提出日時 2020-08-06 16:11:19
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 186 ms / 2,000 ms
コード長 304 bytes
コンパイル時間 422 ms
コンパイル使用メモリ 11,940 KB
実行使用メモリ 21,640 KB
最終ジャッジ日時 2023-10-19 23:14:24
合計ジャッジ時間 2,985 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,240 KB
testcase_01 AC 30 ms
10,240 KB
testcase_02 AC 31 ms
10,256 KB
testcase_03 AC 49 ms
11,560 KB
testcase_04 AC 185 ms
21,188 KB
testcase_05 AC 55 ms
11,888 KB
testcase_06 AC 103 ms
15,552 KB
testcase_07 AC 159 ms
19,076 KB
testcase_08 AC 183 ms
21,188 KB
testcase_09 AC 76 ms
13,560 KB
testcase_10 AC 44 ms
11,232 KB
testcase_11 AC 94 ms
15,004 KB
testcase_12 AC 186 ms
21,640 KB
testcase_13 AC 29 ms
10,240 KB
testcase_14 AC 74 ms
13,296 KB
testcase_15 AC 156 ms
19,340 KB
testcase_16 AC 87 ms
14,352 KB
testcase_17 AC 29 ms
10,244 KB
testcase_18 AC 31 ms
10,372 KB
testcase_19 AC 78 ms
13,824 KB
testcase_20 AC 33 ms
10,312 KB
testcase_21 AC 43 ms
11,160 KB
testcase_22 AC 37 ms
10,688 KB
権限があれば一括ダウンロードができます

ソースコード

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