結果
| 問題 |
No.917 Make One With GCD
|
| ユーザー |
brthyyjp
|
| 提出日時 | 2022-02-11 18:42:00 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 55 ms / 2,000 ms |
| コード長 | 258 bytes |
| コンパイル時間 | 342 ms |
| コンパイル使用メモリ | 82,048 KB |
| 実行使用メモリ | 62,720 KB |
| 最終ジャッジ日時 | 2024-06-27 13:35:29 |
| 合計ジャッジ時間 | 2,990 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 32 |
ソースコード
n = int(input())
A = list(map(int, input().split()))
import math
from collections import Counter
dp = Counter()
dp[0] = 1
for a in A:
nx = Counter()
for g, v in dp.items():
nx[g] += v
nx[math.gcd(a, g)] += v
dp = nx
print(dp[1])
brthyyjp