結果

問題 No.1146 土偶Ⅰ
ユーザー HAGI_TAROHAGI_TARO
提出日時 2021-10-28 10:05:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 97 ms / 2,000 ms
コード長 199 bytes
コンパイル時間 275 ms
コンパイル使用メモリ 82,788 KB
実行使用メモリ 70,528 KB
最終ジャッジ日時 2024-04-16 13:01:22
合計ジャッジ時間 2,859 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
52,272 KB
testcase_01 AC 41 ms
52,352 KB
testcase_02 AC 41 ms
52,480 KB
testcase_03 AC 59 ms
61,952 KB
testcase_04 AC 96 ms
69,760 KB
testcase_05 AC 61 ms
62,592 KB
testcase_06 AC 76 ms
65,536 KB
testcase_07 AC 90 ms
68,224 KB
testcase_08 AC 95 ms
70,016 KB
testcase_09 AC 69 ms
63,872 KB
testcase_10 AC 55 ms
60,544 KB
testcase_11 AC 73 ms
64,768 KB
testcase_12 AC 97 ms
70,528 KB
testcase_13 AC 41 ms
52,096 KB
testcase_14 AC 67 ms
63,488 KB
testcase_15 AC 92 ms
68,864 KB
testcase_16 AC 72 ms
64,384 KB
testcase_17 AC 42 ms
52,224 KB
testcase_18 AC 48 ms
59,136 KB
testcase_19 AC 69 ms
64,640 KB
testcase_20 AC 48 ms
59,136 KB
testcase_21 AC 53 ms
60,160 KB
testcase_22 AC 51 ms
59,904 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools
import math
n = int(input())
A = [int(input()) for _ in range(n)]
ans = 0
for a,b,c in itertools.combinations(A,3):
    if math.gcd(math.gcd(a,b),c) == 1:
        ans += 1
print(ans)
0