結果

問題 No.1146 土偶Ⅰ
ユーザー matriematrie
提出日時 2020-12-19 23:04:32
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 161 ms / 2,000 ms
コード長 207 bytes
コンパイル時間 119 ms
コンパイル使用メモリ 11,808 KB
実行使用メモリ 21,656 KB
最終ジャッジ日時 2023-10-21 09:40:40
合計ジャッジ時間 2,742 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,168 KB
testcase_01 AC 32 ms
10,168 KB
testcase_02 AC 30 ms
10,184 KB
testcase_03 AC 46 ms
11,508 KB
testcase_04 AC 157 ms
21,316 KB
testcase_05 AC 50 ms
11,812 KB
testcase_06 AC 92 ms
15,624 KB
testcase_07 AC 139 ms
19,108 KB
testcase_08 AC 159 ms
21,316 KB
testcase_09 AC 69 ms
13,636 KB
testcase_10 AC 42 ms
11,164 KB
testcase_11 AC 84 ms
15,020 KB
testcase_12 AC 161 ms
21,656 KB
testcase_13 AC 29 ms
10,168 KB
testcase_14 AC 68 ms
13,484 KB
testcase_15 AC 133 ms
19,404 KB
testcase_16 AC 78 ms
14,464 KB
testcase_17 AC 30 ms
10,172 KB
testcase_18 AC 31 ms
10,308 KB
testcase_19 AC 70 ms
13,792 KB
testcase_20 AC 30 ms
10,248 KB
testcase_21 AC 42 ms
11,096 KB
testcase_22 AC 37 ms
10,620 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
import itertools
def gcd(a,b,c): return math.gcd(math.gcd(a,b),c)

n=int(input())
l=[int(input()) for _ in [0]*n]
x=list(itertools.combinations(l,3))
c=0
for i in x:
	if gcd(*i)==1: c+=1
print(c)
0