結果

問題 No.1146 土偶Ⅰ
ユーザー jj1gujjj1guj
提出日時 2020-08-20 16:20:32
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 143 ms / 2,000 ms
コード長 237 bytes
コンパイル時間 90 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-04-21 14:05:58
合計ジャッジ時間 2,616 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
10,752 KB
testcase_01 AC 29 ms
10,752 KB
testcase_02 AC 31 ms
10,880 KB
testcase_03 AC 48 ms
10,880 KB
testcase_04 AC 135 ms
10,880 KB
testcase_05 AC 50 ms
10,752 KB
testcase_06 AC 84 ms
10,752 KB
testcase_07 AC 116 ms
10,880 KB
testcase_08 AC 143 ms
10,752 KB
testcase_09 AC 67 ms
10,880 KB
testcase_10 AC 42 ms
10,880 KB
testcase_11 AC 80 ms
10,752 KB
testcase_12 AC 141 ms
10,752 KB
testcase_13 AC 31 ms
10,752 KB
testcase_14 AC 65 ms
10,752 KB
testcase_15 AC 121 ms
10,880 KB
testcase_16 AC 77 ms
10,752 KB
testcase_17 AC 32 ms
10,752 KB
testcase_18 AC 33 ms
10,752 KB
testcase_19 AC 68 ms
10,880 KB
testcase_20 AC 32 ms
10,752 KB
testcase_21 AC 41 ms
10,752 KB
testcase_22 AC 34 ms
10,880 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
n=int(input())
A=[int(input()) for i in range(n)]
ans=0

for i in range(n-2):
    for j in range(i+1,n-1):
        for k in range(j+1,n):
            if math.gcd(A[i],math.gcd(A[j],A[k]))==1:
                ans+=1
print(ans)
0