結果

問題 No.1146 土偶Ⅰ
ユーザー 👑 KazunKazun
提出日時 2020-08-05 18:47:45
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 209 ms / 2,000 ms
コード長 348 bytes
コンパイル時間 842 ms
コンパイル使用メモリ 81,408 KB
実行使用メモリ 103,860 KB
最終ジャッジ日時 2023-10-17 10:21:39
合計ジャッジ時間 4,625 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,512 KB
testcase_01 AC 40 ms
53,512 KB
testcase_02 AC 39 ms
53,512 KB
testcase_03 AC 108 ms
78,096 KB
testcase_04 AC 207 ms
98,364 KB
testcase_05 AC 108 ms
78,316 KB
testcase_06 AC 144 ms
85,500 KB
testcase_07 AC 166 ms
91,020 KB
testcase_08 AC 208 ms
98,316 KB
testcase_09 AC 125 ms
80,968 KB
testcase_10 AC 97 ms
77,040 KB
testcase_11 AC 142 ms
84,652 KB
testcase_12 AC 209 ms
103,860 KB
testcase_13 AC 38 ms
53,528 KB
testcase_14 AC 122 ms
81,236 KB
testcase_15 AC 171 ms
90,968 KB
testcase_16 AC 135 ms
83,648 KB
testcase_17 AC 39 ms
53,528 KB
testcase_18 AC 57 ms
66,276 KB
testcase_19 AC 124 ms
81,828 KB
testcase_20 AC 48 ms
62,012 KB
testcase_21 AC 98 ms
76,924 KB
testcase_22 AC 79 ms
73,980 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import gcd
N=int(input())
A=[0]*N

for i in range(N):
    A[i]=int(input())

S=set()
for i in range(N):
    for j in range(i+1,N):
        for k in range(j+1,N):
            x,y,z=A[i],A[j],A[k]
            p,r=min(x,y,z),max(x,y,z)
            q=x+y+z-(p+r)
            if gcd(gcd(p,q),r)==1:
                S.add((p,q,r))
print(len(S))
0