結果

問題 No.1146 土偶Ⅰ
ユーザー roarisroaris
提出日時 2020-08-05 18:32:17
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 139 ms / 2,000 ms
コード長 292 bytes
コンパイル時間 1,357 ms
コンパイル使用メモリ 81,776 KB
実行使用メモリ 75,472 KB
最終ジャッジ日時 2023-10-17 09:57:34
合計ジャッジ時間 3,166 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,508 KB
testcase_01 AC 38 ms
53,508 KB
testcase_02 AC 40 ms
59,100 KB
testcase_03 AC 73 ms
75,452 KB
testcase_04 AC 138 ms
75,472 KB
testcase_05 AC 70 ms
75,448 KB
testcase_06 AC 96 ms
75,460 KB
testcase_07 AC 122 ms
75,472 KB
testcase_08 AC 135 ms
75,472 KB
testcase_09 AC 81 ms
75,456 KB
testcase_10 AC 60 ms
75,388 KB
testcase_11 AC 90 ms
75,456 KB
testcase_12 AC 139 ms
75,468 KB
testcase_13 AC 37 ms
53,508 KB
testcase_14 AC 81 ms
75,452 KB
testcase_15 AC 124 ms
75,472 KB
testcase_16 AC 88 ms
75,460 KB
testcase_17 AC 39 ms
57,016 KB
testcase_18 AC 47 ms
63,932 KB
testcase_19 AC 83 ms
75,460 KB
testcase_20 AC 46 ms
62,080 KB
testcase_21 AC 60 ms
75,388 KB
testcase_22 AC 52 ms
70,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def gcd(a, b):
    while b:
        a, b = b, a%b
    return a
    
n = int(input())
a = [int(input()) for _ in range(n)]
ans = 0

for i in range(n):
    for j in range(i+1, n):
        for k in range(j+1, n):
            if gcd(gcd(a[i], a[j]), a[k])==1:
                ans += 1

print(ans)
0