結果
| 問題 | No.1146 土偶Ⅰ |
| ユーザー |
r_ishida
|
| 提出日時 | 2026-03-11 00:40:07 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 70 ms / 2,000 ms |
| コード長 | 545 bytes |
| 記録 | |
| コンパイル時間 | 307 ms |
| コンパイル使用メモリ | 85,580 KB |
| 実行使用メモリ | 80,816 KB |
| 最終ジャッジ日時 | 2026-03-11 00:40:10 |
| 合計ジャッジ時間 | 2,611 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 |
ソースコード
import math
import sys
def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
n = I()
a = []
for i in range(n):
a.append(I())
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], a[j], a[k]) == 1:
ans += 1
print(ans)
r_ishida