結果
| 問題 |
No.1146 土偶Ⅰ
|
| ユーザー |
brthyyjp
|
| 提出日時 | 2020-12-21 07:07:48 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 129 ms / 2,000 ms |
| コード長 | 332 bytes |
| コンパイル時間 | 183 ms |
| コンパイル使用メモリ | 82,100 KB |
| 実行使用メモリ | 76,800 KB |
| 最終ジャッジ日時 | 2024-09-21 12:41:16 |
| 合計ジャッジ時間 | 3,122 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 |
ソースコード
n = int(input())
A = [int(input()) for i in range(n)]
import math
from functools import reduce
def gcd(*numbers):
return reduce(math.gcd, numbers)
def gcd_list(numbers):
return reduce(math.gcd, numbers)
import itertools
ans = 0
for c in itertools.combinations(A, 3):
if gcd_list(c) == 1:
ans += 1
print(ans)
brthyyjp