結果

問題 No.1146 土偶Ⅰ
ユーザー NatsubiSoganNatsubiSogan
提出日時 2021-06-27 16:00:03
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 112 ms / 2,000 ms
コード長 244 bytes
コンパイル時間 153 ms
コンパイル使用メモリ 10,672 KB
実行使用メモリ 8,288 KB
最終ジャッジ日時 2023-09-07 18:00:55
合計ジャッジ時間 2,164 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,200 KB
testcase_01 AC 17 ms
8,200 KB
testcase_02 AC 17 ms
8,108 KB
testcase_03 AC 28 ms
8,228 KB
testcase_04 AC 109 ms
8,152 KB
testcase_05 AC 31 ms
8,088 KB
testcase_06 AC 62 ms
8,212 KB
testcase_07 AC 92 ms
8,208 KB
testcase_08 AC 112 ms
8,256 KB
testcase_09 AC 45 ms
8,132 KB
testcase_10 AC 24 ms
8,200 KB
testcase_11 AC 56 ms
8,224 KB
testcase_12 AC 108 ms
8,236 KB
testcase_13 AC 15 ms
8,176 KB
testcase_14 AC 43 ms
8,252 KB
testcase_15 AC 93 ms
8,124 KB
testcase_16 AC 52 ms
8,212 KB
testcase_17 AC 15 ms
8,204 KB
testcase_18 AC 17 ms
8,216 KB
testcase_19 AC 45 ms
8,132 KB
testcase_20 AC 17 ms
8,288 KB
testcase_21 AC 23 ms
8,152 KB
testcase_22 AC 19 ms
8,260 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = [int(input()) for i in range(n)]
ans = 0
from math import gcd
for i in range(n):
    for j in range(i + 1, n):
        for k in range(j + 1, n):
            if gcd(a[i], a[j], a[k]) == 1:
                ans += 1
print(ans)
0