結果

問題 No.1146 土偶Ⅰ
ユーザー dangodango
提出日時 2023-06-25 08:38:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 339 ms / 2,000 ms
コード長 381 bytes
コンパイル時間 405 ms
コンパイル使用メモリ 87,012 KB
実行使用メモリ 80,328 KB
最終ジャッジ日時 2023-09-15 06:13:41
合計ジャッジ時間 5,915 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,108 KB
testcase_01 AC 74 ms
71,544 KB
testcase_02 AC 84 ms
75,232 KB
testcase_03 AC 231 ms
80,328 KB
testcase_04 AC 253 ms
78,184 KB
testcase_05 AC 148 ms
78,168 KB
testcase_06 AC 238 ms
79,184 KB
testcase_07 AC 219 ms
77,804 KB
testcase_08 AC 324 ms
79,280 KB
testcase_09 AC 185 ms
78,664 KB
testcase_10 AC 149 ms
78,564 KB
testcase_11 AC 277 ms
80,280 KB
testcase_12 AC 339 ms
78,912 KB
testcase_13 AC 76 ms
71,348 KB
testcase_14 AC 165 ms
77,760 KB
testcase_15 AC 227 ms
77,552 KB
testcase_16 AC 191 ms
78,324 KB
testcase_17 AC 75 ms
71,432 KB
testcase_18 AC 110 ms
77,068 KB
testcase_19 AC 211 ms
79,396 KB
testcase_20 AC 98 ms
76,316 KB
testcase_21 AC 131 ms
78,224 KB
testcase_22 AC 121 ms
77,804 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
sys.setrecursionlimit(1500000)
def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a % b)
a = []
ans = 0
for _ in range(int(input())):
    a.append(int(input()))
for i in range(len(a)):
    for j in range(i + 1, len(a)):
        for k in range(j + 1, len(a)):
            if gcd(gcd(a[i], a[j]), a[k]) == 1:
                ans += 1
print(ans)
0